Re: C11 / VS 2019

From: Peter Eisentraut <peter(at)eisentraut(dot)org>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: C11 / VS 2019
Date: 2025-08-19 21:31:56
Message-ID: ac20eac8-551b-4aaf-b43d-955c61fd4219@eisentraut.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 18.08.25 15:27, Andres Freund wrote:
> On 2025-07-18 14:12:34 +0300, Peter Eisentraut wrote:
>> I also moved the test a bit earlier in meson.build, as a separate patch,
>> because between the place where the compiler is first set up and the place
>> where we detected the C99 options, if any, there were already some tests run
>> that use the compiler. I don't think this was a big problem in practice,
>> but it seems a bit incorrect, so it makes sense to correct it.
>
> I distinctly dislike this. You mashed a compiler test in the middle of
> something else, without updating any comments. We now do one compiler test
> earlier, then dependency tests, and then other compiler tests.

I think these are different things. The C99 test is something that
potentially adds a compiler flag and changes the mode of the compiler.
So we need to do this first before we test anything else with the compiler.

The other compiler tests are just checking what the compiler is doing
and record the result. This does not affect subsequent tests. Ok,
there are some tests for warning flags and some -f options, but there
are also arguments to be made that these should be set before checking
external library headers for example.

So calling all of these compiler tests doesn't capture the necessary
distinction. I would think of these maybe as compiler flag tests versus
compiler characteristics tests.

> Doing anything
> the order we do it in autoconf is an anti-argument, because the ordering we
> use in autoconf is completely unintelligible.

The point is that autoconf does the C-standard determination first,
before doing anything else with the compiler. That is clearly the
correct thing to do.

Btw., the ordering is documented at the top of configure.ac, but it has
surely degraded over time.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Nathan Bossart 2025-08-19 21:34:56 fix comment for MAX_SIMUL_LWLOCKS
Previous Message Nathan Bossart 2025-08-19 21:20:10 Re: Improve LWLock tranche name visibility across backends