Re: problem building Gnulib libgnu_a-malloca.o with Debian oldstable's clang

Lasse Collin <[email protected]>
Newsgroups gmane.comp.lib.gnulib.bugs
Message-ID <[email protected]>
On 2026-08-06 G. Branden Robinson wrote:
> ../lib/malloca.c:49:56: error: too few arguments provided to function-like macro invocation
> static_assert (2 * sa_alignment_max - 1 <= (small_t) -1);
>                                                        ^
> /usr/include/x86_64-linux-gnu/sys/cdefs.h:447:10: note: macro '_Static_assert' defined here
> # define _Static_assert(expr, diagnostic) \
>          ^
> ../lib/malloca.c:49:57: error: expected '('
> static_assert (2 * sa_alignment_max - 1 <= (small_t) -1);

Based on the cdefs.h line number 447, this is on Debian Bullseye
(oldoldstable), not Debian Bookworm (oldstable). The old cdefs.h
doesn't check for __clang_major__ >= 4 which was added in glibc commit
c8ba52ab3350c3 ("misc: Sync cdefs.h with gnulib"), and then cdefs.h
defines _Static_assert as a macro when the compiler isn't in C11 or
newer mode. So the compiler probably is in C99 mode.

From groff-1.25.0.rc2/configure.ac:

# Autoconf [2.70,2.72] tries to cram C11 and C++11 down our throats.  We
# don't (yet) want them.
ac_cv_prog_cc_c11=no

I didn't investigate if the above is the reason why Gnulib doesn't
override static_assert with its own version that support C23's
single-argument form.

Maybe not relevant, but building groff on a modern distro with
CC='clang -std=gnu99' results in these lines in Makefile:

CC = clang -std=gnu99
CPP = clang -std=gnu99 -std=gnu11 -E

That is, even if ac_cv_prog_cc_c11=no is forced, CPP will be in GNU C11
mode.

-- 
Lasse Collin
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.