On nix, where _FORTIFY_SOURCE is enabled by default, CDE fails to build with "buffer overflow detected" error:
DTSRCREATE Successfully initialized database 'CDEDOC'.
dtsrload -dCDEDOC '-t
' CDEDOC
/build/cde-2.5.3/programs/dtsr/.libs/lt-dtsrload: Version 0.6. Run Thursday, Apr 23 2026, 10:28 AM.
/build/cde-2.5.3/programs/dtsr/.libs/lt-dtsrload: cwd = '/build/cde-2.5.3/doc/en_US.UTF-8/cde.dti/CDEDOC/dtsearch', fzkfile = 'CDEDOC.fzk'
/build/cde-2.5.3/programs/dtsr/.libs/lt-dtsrload: 'CDEDOC' schema ver = 2.0, rec count = 0, last slot = 0.
/build/cde-2.5.3/programs/dtsr/.libs/lt-dtsrload: Each dot = 20 records processed.
*** buffer overflow detected ***: terminated
dtdocbook2infolib: command failed: dtsrload -dCDEDOC '-t
' CDEDOC
The underlying issue is in lib/DtSearch/isduprec.c where we have a structure defined as:
typedef struct hash_tag {
struct hash_tag *link;
char recid[2]; /* actual array size varies */
} HASHNODE;
The issue is the variable length array is defined as char [2] which is apparently not recognized as a variable length array by gcc. Turns out the only legal way to define such thing starting from C99 is called "Flexible Array Members" and requires the array to have the size field omitted, i.e. char [] here.
cc @jon13