On Jun 8, 2024, at 12:38 PM, Paul Eggert <egg...@cs.ucla.edu> wrote:

> (Moving this from <https://savannah.gnu.org/support/?111072> to 
> <mailto:bug-gnulib@gnu.org> because it's Gnulib, not Autoconf.]

Sorry.

>> Recently, I started getting warnings like:
>> ./slist.h:170:1: warning: [[]] attributes are a C23 extension
>> [-Wc23-extensions]
>>   170 | NODISCARD
>>       | ^
>> ../lib/attribute.h:143:19: note: expanded from macro 'NODISCARD'
>>   143 | #define NODISCARD _GL_ATTRIBUTE_NODISCARD
>>       |                   ^
>> ./config.h:1392:37: note: expanded from macro '_GL_ATTRIBUTE_NODISCARD'
>>  1392 | #    define _GL_ATTRIBUTE_NODISCARD [[__nodiscard__]]
>>       |                                     ^
> 
> It looks like -Wc23-extensions is the problem. If you stop using it (or if 
> you also use -std=gnu23), you shouldn't get those warnings. At least, that's 
> the behavior I see with clang 18.1.6 (a bit later than your clang) on Fedora.

FYI, I’m not using that option.  The options I am using are:

-DHAVE_CONFIG_H
-D_THREAD_SAFE
-D_ISOC11_SOURCE
-Wall
-Wcast-align
-Wcast-function-type
-Wcomma
-Wconditional-type-mismatch
-Wconditional-uninitialized
-Wconversion
-Wduplicate-enum
-Wembedded-directive
-Wenum-enum-conversion
-Wenum-float-conversion
-Wextra
-Wfloat-equal
-Wfor-loop-analysis
-Wformat-nonliteral
-Wformat-type-confusion
-Wformat=2
-Widiomatic-parentheses
-Wimplicit-fallthrough
-Wlogical-op-parentheses
-Wmisleading-indentation
-Wnewline-eof
-Wpedantic
-Wredundant-decls
-Wshadow
-Wshift-sign-overflow
-Wshorten-64-to-32
-Wsign-compare
-Wsign-conversion
-Wsometimes-uninitialized
-Wstring-conversion
-Wtautological-compare
-Wtautological-type-limit-compare
-Wundef
-Wuninitialized
-Wunreachable-code-break
-Wunreachable-code-return
-Wunreachable-code
-Wunused
-Wwrite-strings
-Wzero-as-null-pointer-constant

- Paul


Reply via email to