David Rowley <dgrowle...@gmail.com> writes:
> On Fri, 18 Jul 2025 at 23:12, Peter Eisentraut <pe...@eisentraut.org> wrote:
>> Note that gcc and clang switched to C11 by default a long time ago
>> (gcc-5 and clang-3.6), so for most users all these tests won't need to
>> do anything.  If you want to test it, you could simulate an older
>> default like
>> ./configure CC='gcc -std=c99'

> On Linux, doing a bit more testing using meson and clang, I tried with
> CC=clang CFLAGS=-std=c99 . I get:

Note that that's not what Peter suggested.  That leads to

> FAILED: src/backend/parser/parser.a.p/meson-generated_.._gram.c.o
> clang -Isrc/backend/parser/parser.a.p -Isrc/backend/parser
> -I../src/backend/parser -Isrc/include -I../src/include
> -I/usr/include/libxml2 -fdiagnostics-color=always
> -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -O2 -g -std=gnu11
                                                    ^^^^^^^^^^
> -fno-strict-aliasing -fwrapv -fexcess-precision=standard -D_GNU_SOURCE
> -Wmissing-prototypes -Wpointer-arith -Werror=vla
> -Werror=unguarded-availability-new -Wendif-labels
> -Wmissing-format-attribute -Wcast-function-type -Wformat-security
> -Wdeclaration-after-statement -Wmissing-variable-declarations
> -Wno-unused-command-line-argument -Wno-compound-token-split-by-macro
> -Wno-format-truncation -Wno-cast-function-type-strict -std=c99 -fPIC
                                                        ^^^^^^^^
> -pthread -DBUILDING_DLL -MD -MQ
> src/backend/parser/parser.a.p/meson-generated_.._gram.c.o -MF
> src/backend/parser/parser.a.p/meson-generated_.._gram.c.o.d -o
> src/backend/parser/parser.a.p/meson-generated_.._gram.c.o -c
> src/backend/parser/gram.c

Apparently we are not being too consistent about the order of
user-specified CFLAGS versus ones added by configuration?
The configuration test must have put the user CFLAGS first.

> Strangely, if I swap the order of the c11_test_args so the test tries
> and uses -std=c11 first, it works ok.

That is indeed weird.

                        regards, tom lane


Reply via email to