From 2da9fd8d06ddeb9505a7f954fe11974bb13c84f7 Mon Sep 17 00:00:00 2001 From: Ivan K Date: Thu, 25 Dec 2025 21:54:06 +0300 Subject: [PATCH 1/6] utils.c: include for siginfo_t POSIX says: > The header shall define the siginfo_t type as a structure So is not enough to see the definition (not just a forward declaration) of siginfo_t. --- src/utils.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/utils.c b/src/utils.c index e11bc09d57..e1e4af13a9 100644 --- a/src/utils.c +++ b/src/utils.c @@ -1,6 +1,7 @@ #ifndef _WIN32 # define _POSIX_C_SOURCE 200809L // required for POSIX (not standard C) features in is_direct_child e.g. 'siginfo_t' -# include +# include // siginfo_t +# include // waitid #endif #include "data.table.h" From 513b017a5837821db701cdb7eebf16b5dc557879 Mon Sep 17 00:00:00 2001 From: Ivan K Date: Thu, 25 Dec 2025 22:48:23 +0300 Subject: [PATCH 2/6] NEWS entry --- NEWS.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/NEWS.md b/NEWS.md index 5c97d3b69e..856df182bd 100644 --- a/NEWS.md +++ b/NEWS.md @@ -4,6 +4,9 @@ ## data.table [v1.18.99](https://github.com/Rdatatable/data.table/milestone/37?closed=1) (in development) +### BUG FIXES + +1. Fixed the compilation failure on FreeBSD due to an `#include` directive missing in v1.18.0, [#7516](https://github.com/rdatatable/data.table/issues/7516). Thanks to @jszhao for the report and @aitap for the fix. ## data.table [v1.18.0](https://github.com/Rdatatable/data.table/milestone/37?closed=1) 23 December 2025 From baaf8ca299d918a8eca9b09f955d0c44e32a978b Mon Sep 17 00:00:00 2001 From: Ivan K Date: Fri, 26 Dec 2025 00:02:44 +0300 Subject: [PATCH 3/6] Amend NEWS --- NEWS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NEWS.md b/NEWS.md index 856df182bd..4d83c61fe5 100644 --- a/NEWS.md +++ b/NEWS.md @@ -6,7 +6,7 @@ ### BUG FIXES -1. Fixed the compilation failure on FreeBSD due to an `#include` directive missing in v1.18.0, [#7516](https://github.com/rdatatable/data.table/issues/7516). Thanks to @jszhao for the report and @aitap for the fix. +1. Fixed the compilation failure in v1.18.0 in some strict environments, e.g., FreeBSD, where the header file declaring the POSIX function `waitid` does not transitively include the header file defining the `siginfo_t` type, [#7516](https://github.com/rdatatable/data.table/issues/7516). Thanks to @jszhao for the report and @aitap for the fix. ## data.table [v1.18.0](https://github.com/Rdatatable/data.table/milestone/37?closed=1) 23 December 2025 From db69eae79ca5b5b2303c7ce384897366768238a9 Mon Sep 17 00:00:00 2001 From: Michael Chirico Date: Wed, 31 Dec 2025 00:47:37 -0800 Subject: [PATCH 4/6] more robustly define _POSIX_C_SOURCE (h/t Hugh) --- src/utils.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/utils.c b/src/utils.c index e1e4af13a9..11ec0c1a70 100644 --- a/src/utils.c +++ b/src/utils.c @@ -1,5 +1,8 @@ #ifndef _WIN32 -# define _POSIX_C_SOURCE 200809L // required for POSIX (not standard C) features in is_direct_child e.g. 'siginfo_t' +# if !defined(_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 200809L +# undef _POSIX_C_SOURCE +# define _POSIX_C_SOURCE 200809L // required for POSIX (not standard C) features in is_direct_child e.g. 'siginfo_t' +# endif # include // siginfo_t # include // waitid #endif From 327e2a53118d0321344821bed54ba963ba8b1061 Mon Sep 17 00:00:00 2001 From: Michael Chirico Date: Wed, 31 Dec 2025 00:49:42 -0800 Subject: [PATCH 5/6] tidy up NEWS --- NEWS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NEWS.md b/NEWS.md index 4d83c61fe5..8fd4c61b82 100644 --- a/NEWS.md +++ b/NEWS.md @@ -6,7 +6,7 @@ ### BUG FIXES -1. Fixed the compilation failure in v1.18.0 in some strict environments, e.g., FreeBSD, where the header file declaring the POSIX function `waitid` does not transitively include the header file defining the `siginfo_t` type, [#7516](https://github.com/rdatatable/data.table/issues/7516). Thanks to @jszhao for the report and @aitap for the fix. +1. Fixed compilation failure like "error: unknown type name 'siginfo_t'" in v1.18.0 in some strict environments, e.g., FreeBSD, where the header file declaring the POSIX function `waitid` does not transitively include the header file defining the `siginfo_t` type, [#7516](https://github.com/rdatatable/data.table/issues/7516). Thanks to @jszhao for the report and @aitap for the fix. ## data.table [v1.18.0](https://github.com/Rdatatable/data.table/milestone/37?closed=1) 23 December 2025 From a5a264418920e5251d00d8ac8683f0efbdea2e5e Mon Sep 17 00:00:00 2001 From: Michael Chirico Date: Thu, 1 Jan 2026 14:51:28 -0800 Subject: [PATCH 6/6] -D_POSIX_C_SOURCE=200809L in gitlab CI job for regression test --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 05cc1e445c..ab3337b07e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -173,8 +173,8 @@ test-lin-dev-gcc-strict-cran: _R_S3_METHOD_LOOKUP_BASEENV_AFTER_GLOBALENV_: "FALSE" ## detects S3 method lookup found on search path #4777 _R_S3_METHOD_LOOKUP_REPORT_SEARCH_PATH_USES_: "TRUE" script: - - echo 'CFLAGS=-g -O2 -flto=auto -fno-common -fopenmp -Wall -Wvla -pedantic -fstack-protector-strong -D_FORTIFY_SOURCE=2' > ~/.R/Makevars - - echo 'CXXFLAGS=-g -O2 -flto=auto -fno-common -fopenmp -Wall -Wvla -pedantic -fstack-protector-strong -D_FORTIFY_SOURCE=2' >> ~/.R/Makevars + - echo 'CFLAGS=-g -O2 -flto=auto -fno-common -fopenmp -Wall -Wvla -pedantic -fstack-protector-strong -D_FORTIFY_SOURCE=2 -D_POSIX_C_SOURCE=200809L' > ~/.R/Makevars + - echo 'CXXFLAGS=-g -O2 -flto=auto -fno-common -fopenmp -Wall -Wvla -pedantic -fstack-protector-strong -D_FORTIFY_SOURCE=2 -D_POSIX_C_SOURCE=200809L' >> ~/.R/Makevars - *install-deps - R CMD check --as-cran $(ls -1t data.table_*.tar.gz | head -n 1) - (! grep "warning:" data.table.Rcheck/00install.out)