Re: gcc 13 warnings

Aleksander Alekseev <aleksander@timescale.com>

From: Aleksander Alekseev <aleksander@timescale.com>
To: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Cc: Andres Freund <andres@anarazel.de>, Peter Eisentraut <peter.eisentraut@enterprisedb.com>, Tom Lane <tgl@sss.pgh.pa.us>, Pavel Stehule <pavel.stehule@gmail.com>, Melanie Plageman <melanieplageman@gmail.com>
Date: 2024-07-15T08:38:42Z
Lists: pgsql-hackers
Hi,

>         /*
>          * Prevent spurious warning due to compiler not realizing
>          * VARATT_IS_EXTERNAL_NON_EXPANDED() branch in assign_simple_var() isn't
>          * reachable due to "found" being byvalue.
>          */
>         if (var->datatype->typlen != 1)
>                 pg_unreachable();
>
> I'm somewhat inclined to think it'd be worth adding something along those
> lines to avoid this warning ([1]).

IMO we shouldn't allow warnings to appear in release builds, even
harmless ones. Otherwise we start ignoring them and will skip
something important one day. So I think we should do this.

-- 
Best regards,
Aleksander Alekseev



Commits

  1. Use pg_assume() to avoid compiler warning below exec_set_found()

  2. Add pg_assume(expr) macro

  3. meson: Change default buildtype to debugoptimized