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

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Tue Jul 14 12:25:39 BST 2026


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=296473

--- Comment #9 from Trond Endrestøl <Trond.Endrestol at ximalas.info> ---
(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, the
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='"/usr/local/share/locale"' -I.
-I..  -I. -I. -I../lib -I.. -I./../libelf -I./../libdwelf -pthread  -std=gnu99
-Wall -Wshadow -Wformat=2 -Wold-style-definition -Wstrict-prototypes   
-Wnull-dereference -Wimplicit-fallthrough -Werror -Wunused -Wextra    
-D_FORTIFY_SOURCE=3 -O2 -pipe -fno-omit-frame-pointer  -I/usr/local/include
-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 expects
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 = ATOMIC_VAR_INIT(0);
      |                                ^
libdw_alloc.c:48:32: error: initializer element is not a compile-time constant
   48 | static atomic_size_t next_id = 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__ >= 201112L && __STDC_VERSION__
<= 201710L) || (defined(__STDC_VERSION__) && __STDC_VERSION__ == 199901L)

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.

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


More information about the kde-freebsd mailing list