[Bug 296473] devel/qt6-base: does not compile on recent CURRENT (1600019)

[email protected] Tue, 14 Jul 2026 11:25:39 +0000
Newsgroups gmane.comp.kde.freebsd
Message-ID <[email protected]/bugzilla/>
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D296473

--- Comment #9 from Trond Endrest=C3=B8l <[email protected]> ---
(In reply to Gleb Popov from comment #8)
It could be either or. It largely depends on how __ISO_C_VISIBLE is handled=
. Is
this macro controlled by the compiler or the programmer? Googling for
__ISO_C_VISIBLE suggests this macro should be controlled by the compilers.

While I understand the need to follow the programming language standards, t=
he
real world is a different beast. stdatomic.h in stable/15 and below isn't as
strict as it is in main.

In comment 7, I was referring to devel/elfutils:

cc -D_GNU_SOURCE -DHAVE_CONFIG_H -DLOCALEDIR=3D'"/usr/local/share/locale"' =
-I.
-I..  -I. -I. -I../lib -I.. -I./../libelf -I./../libdwelf -pthread  -std=3D=
gnu99
-Wall -Wshadow -Wformat=3D2 -Wold-style-definition -Wstrict-prototypes=20=
=20=20
-Wnull-dereference -Wimplicit-fallthrough -Werror -Wunused -Wextra=20=20=20=
=20
-D_FORTIFY_SOURCE=3D3 -O2 -pipe -fno-omit-frame-pointer  -I/usr/local/inclu=
de
-I/usr/local/share/gnulib/lib -DFREEBSD_HAS_MEMPCPY -Wno-error
-Wno-format-nonliteral -Wno-null-dereference -Wno-unused-value
-fstack-protector-strong -fno-strict-aliasing  -MT libdw_alloc.o -MD -MP -MF
.deps/libdw_alloc.Tpo -c -o libdw_alloc.o libdw_alloc.c

libdw_alloc.c is compiled with gnu99 as the chosen C standard, yet it expec=
ts
to use ATOMIC_VAR_INIT which was introduced in c11, deprecated in c17, and
removed in c23.

In file included from libdw_alloc.c:31:
In file included from ../config.h:197:
../lib/eu-config.h:283:9: warning: 'strndupa' macro redefined
[-Wmacro-redefined]
  283 | #define strndupa(s, n)  \
      |         ^
/usr/include/string.h:171:9: note: previous definition is here
  171 | #define strndupa(_Str, _Maxlen) (__extension__({                \
      |         ^
libdw_alloc.c:48:32: warning: call to undeclared function 'ATOMIC_VAR_INIT';
ISO C99 and later do not support implicit function declarations
[-Wimplicit-function-declaration]
   48 | static atomic_size_t next_id =3D ATOMIC_VAR_INIT(0);
      |                                ^
libdw_alloc.c:48:32: error: initializer element is not a compile-time const=
ant
   48 | static atomic_size_t next_id =3D ATOMIC_VAR_INIT(0);
      |                                ^~~~~~~~~~~~~~~~~~
2 warnings and 1 error generated.
gmake[3]: *** [Makefile:901: libdw_alloc.o] Error 1

devel/elfutils only built successfully after I added an exception for c99 in
stdatomic.h:

#if __BSD_VISIBLE || __ISO_C_VISIBLE < 2023 || defined(__cplusplus) ||
(defined(__STDC_VERSION__) && __STDC_VERSION__ >=3D 201112L && __STDC_VERSI=
ON__
<=3D 201710L) || (defined(__STDC_VERSION__) && __STDC_VERSION__ =3D=3D 1999=
01L)

The fact that I had to add exceptions for c11, c17, and c99, suggests to me
that __ISO_C_VISIBLE isn't handled correctly in main.

--=20
You are receiving this mail because:
You are the assignee for the bug.=