bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: lib/malloca.c: error when compiling "groff"


From: Bjarni Ingi Gislason
Subject: Re: lib/malloca.c: error when compiling "groff"
Date: Thu, 15 Sep 2022 00:38:34 +0000

  I get the same error with "gcc-11 (Debian 11.3.0-5) 11.3.0" and gcc-10

  In "config.log" I see:

configure:21128: checking for static_assert
configure:21162: /usr/bin/gcc-10 -c -Walloc-zero -Walloca -Wall -Wextra 
-Wformat=2 -Wattribute-warning -Wdate-time -Wformat-security 
-Wfree-nonheap-object -Wimplicit-fallthrough=3 -Wmaybe-uninitialized 
-Wstringop-overflow=4 -Wredundant-decls -Wshadow=global -Wuninitialized 
-Wunused -Wunused-parameter -Wvla -fdiagnostics-generate-patch -fsanitize=bool 
-fsanitize=enum -fsanitize=signed-integer-overflow 
-fsanitize=integer-divide-by-zero,shift,null -fsanitize-undefined-trap-on-error 
-fno-sanitize=pointer-overflow -fsanitize=return 
-fsanitize=alignment,object-size,vptr,pointer-overflow -O0 
-fstack-protector-strong -fno-common -fstack-clash-protection -ftrapv 
-funsigned-char -fvar-tracking-assignments -ggdb3 -pedantic -fsanitize=null 
-fsanitize=nonnull-attribute  -Wmissing-prototypes -Wold-style-definition 
-Wstrict-prototypes  -Wold-style-declaration  -std=c2x  -D_FORTIFY_SOURCE=2 
-DGCC_LINT -DGNULIB_NO_VLA  conftest.c >&5
conftest.c:125:28: error: expected declaration specifiers or '...' before 
numeric constant
  125 |             static_assert (2 + 2 == 4, "arithmetic does not work");
      |                            ^
conftest.c:125:40: error: expected declaration specifiers or '...' before 
string constant
  125 |             static_assert (2 + 2 == 4, "arithmetic does not work");
      |                                        ^~~~~~~~~~~~~~~~~~~~~~~~~~
conftest.c:126:28: error: expected declaration specifiers or '...' before 
numeric constant
  126 |             static_assert (2 + 2 == 4);
      |                            ^
conftest.c: In function 'main':
conftest.c:132:13: warning: implicit declaration of function 'static_assert' 
[-Wimplicit-function-declaration]
  132 |             static_assert (sizeof (char) == 1, "sizeof does not work");
      |             ^~~~~~~~~~~~~
configure:21162: $? = 1

  In /usr/include/assert.h is

#if defined __USE_ISOC11 && !defined __cplusplus
# undef static_assert
# define static_assert _Static_assert
#endif

  Adding "-D__USE_ISOC11" to CPPFLAGS shows the same lines in "config.log".

  "assert.h" is from Debian 

Package: libc6-dev
[...]
Source: glibc
Version: 2.34-7



reply via email to

[Prev in Thread] Current Thread [Next in Thread]