Skip to content

Fix illegal redefinition of _Bool#300

Open
jengelh wants to merge 1 commit intoNLnetLabs:developfrom
jengelh:develop
Open

Fix illegal redefinition of _Bool#300
jengelh wants to merge 1 commit intoNLnetLabs:developfrom
jengelh:develop

Conversation

@jengelh
Copy link
Copy Markdown

@jengelh jengelh commented Mar 27, 2026

ldns does not build under gcc-15/glibc-2.43. The error is:

.//libtool --tag=CC --quiet --mode=compile gcc -I. -I.  -DHAVE_CONFIG_H -DLDNS_TRUST_ANCHOR_FILE="\"/etc/unbound/root.key\"" -DOPENSSL_API_COMPAT=10100 -fno-strict-aliasing -Wunused-function -Wstrict-prototypes -Wwrite-strings -W -Wall -O2 -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g -fno-strict-aliasing -D_GNU_SOURCE -I./include/ldns  -I/usr/include/python3.13 -Wno-unused-variable -Wno-unused-parameter -Wno-missing-field-initializers -fno-strict-aliasing -c ./contrib/python/ldns_wrapper.c -o ldns_wrapper.lo
In file included from ./ldns/buffer.h:16,
		 from ./include/ldns/ldns.h:96,
		 from ./contrib/python/ldns_wrapper.c:3547:
/usr/include/assert.h:114:14: error: conflicting types for '__assert_single_arg'; have 'signed char(signed char)'
  114 | extern _Bool __assert_single_arg (_Bool);
      |              ^~~~~~~~~~~~~~~~~~~
In file included from /usr/include/python3.13/Python.h:20,
		 from ./contrib/python/ldns_wrapper.c:203:
/usr/include/assert.h:114:14: note: previous declaration of '__assert_single_arg' with type '_Bool(_Bool)'
  114 | extern _Bool __assert_single_arg (_Bool);
      |              ^~~~~~~~~~~~~~~~~~~

The reduced test case is:

#include <assert.h>
#define _Bool signed char
#include <assert.h>
// gcc-15 -c 1.c

Identifiers starting with an underscore are reserved for the implementation. Redefinining them can break compilation in funny ways (like this).

Stop redefinining/redeclaring internal identifiers. Delete references to the autoconf manual, because they too have removed that ugly snippet in commit v2.72a-68-g6f2aadd7.

ldns does not build under gcc-15/glibc-2.43. The error is:

.. code-block:

	./libtool --tag=CC --quiet --mode=compile gcc -I. -I.  -DHAVE_CONFIG_H -DLDNS_TRUST_ANCHOR_FILE="\"/etc/unbound/root.key\"" -DOPENSSL_API_COMPAT=10100 -fno-strict-aliasing -Wunused-function -Wstrict-prototypes -Wwrite-strings -W -Wall -O2 -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g -fno-strict-aliasing -D_GNU_SOURCE -I./include/ldns  -I/usr/include/python3.13 -Wno-unused-variable -Wno-unused-parameter -Wno-missing-field-initializers -fno-strict-aliasing -c ./contrib/python/ldns_wrapper.c -o ldns_wrapper.lo
	In file included from ./ldns/buffer.h:16,
			 from ./include/ldns/ldns.h:96,
			 from ./contrib/python/ldns_wrapper.c:3547:
	/usr/include/assert.h:114:14: error: conflicting types for '__assert_single_arg'; have 'signed char(signed char)'
	  114 | extern _Bool __assert_single_arg (_Bool);
	      |              ^~~~~~~~~~~~~~~~~~~
	In file included from /usr/include/python3.13/Python.h:20,
			 from ./contrib/python/ldns_wrapper.c:203:
	/usr/include/assert.h:114:14: note: previous declaration of '__assert_single_arg' with type '_Bool(_Bool)'
	  114 | extern _Bool __assert_single_arg (_Bool);
	      |              ^~~~~~~~~~~~~~~~~~~

The reduced test case is:

.. code-block:: c

	#include <assert.h>
	#define _Bool signed char
	#include <assert.h>
	// gcc-15 -c -std=c23 1.c

Identifiers starting with an underscore are reserved for the
implementation. Redefinining them can break compilation in funny ways
(like this).

Stop redefinining/redeclaring internal identifiers. Delete references
to the autoconf manual, because they too have removed that ugly
snippet in commit v2.72a-68-g6f2aadd7 .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant