Closed jengelh closed 3 years ago
This looks to be a problem with the upstream GnuLib since I'm not the author of lib/string.h
. I've test compiled this on a few Linux x86_64 platforms, FreeBSD, Solaris (Sparc, AMD, and Intel), and macOS (Intel and M1) and all compile just fine. I don't have access to any OpenSuse Linux platforms to build.
Both src/lexer.c and lib/string.h have no #include "config.h"
, so they do not know the definition of _GL_ATTRIBUTE_MALLOC
.
lib/string.h happens to redefine _GL_ATTRIBUTE_PURE
on its own, which is why it only fails from the strdup line onwards, and not with any of the prior prototypes.
lexer.l
has #include "pjl_config.h"
as the very first #include
since cdecl's code always uses pjl_config.h
(for reasons explained in its comments) and not config.h
directly.
# if (!1 || __GNUC__ >= 11) && !defined strdup
_GL_FUNCDECL_SYS (strdup, char *,
(char const *__s)
_GL_ARG_NONNULL ((1))
_GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE);
# endif
Tumbleweed uses gcc 11, which is why it only fails on that version of SUSE. (The older releases have gcc7.)
It's still looking like an issue with the upstream GnuLib and not cdecl. The GnuLib maintainers occasionally break things.
Were you going to raise the issue with GnuLib?
I determined the author of the lines that cause me this trible (@bhaible) and sent a private mail now.
If you could keep me posted, perhaps paste a link to a created issue, then I'd know when the upstream issue is fixed so I could update the copy of GnuLib inside cdecl, that would be good.
Should be fixed in Gnulib, through https://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=commitdiff;h=354f27fea9bd4ecb53980de6bd374434a204afc5 .
I've pull
d from GnuLib, updated cdecl, and push
d to master. Try building master. Since it's not a released build, you'll need to run bootstrap
manually to generate configure
. Let me know if it's fixed.
Confirmed as fixed.
https://build.opensuse.org/package/live_build_log/devel:tools/cdecl/openSUSE_Tumbleweed/x86_64
gcc -E has to say