Re: compiler warnings with gcc 4.8 and -Og

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Justin Pryzby <pryzby(at)telsasoft(dot)com>
Cc: Andres Freund <andres(at)anarazel(dot)de>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Robert Haas <robertmhaas(at)gmail(dot)com>, Andrew Dunstan <andrew(at)dunslane(dot)net>, pgsql-hackers(at)postgresql(dot)org, Thomas Munro <thomas(dot)munro(at)gmail(dot)com>, Melanie Plageman <melanieplageman(at)gmail(dot)com>, Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>, Daniel Gustafsson <daniel(at)yesql(dot)se>
Subject: Re: compiler warnings with gcc 4.8 and -Og
Date: 2022-06-02 04:24:28
Message-ID: Ypg7fOeUmGarOHfN@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Jun 01, 2022 at 09:42:44PM -0500, Justin Pryzby wrote:
> Today's "warnings" thread suggests to me that these are worth fixing - it seems
> reasonable to compile postgres 14 on centos7 (as I sometimes have done), and
> the patch seems even more reasonable when backpatched to older versions.
> (Also, I wonder if there's any consideration to backpatch cirrus.yaml, which
> uses -Og)

https://en.wikipedia.org/wiki/CentOS#CentOS_releases tells that centos
7 will be supported until the end of 2024, so I would fix that.

> The patch below applies and fixes warnings back to v13.

I don't mind fixing what you have here, as a first step. All those
cases are telling us that the compiler does not see PG_TRY() as
something is can rely on to set up each variable. 7292fd8 is
complaining about the same point, actually, aka setjmp clobberring the
variable, isn't it? So wouldn't it be better to initialize them, as
your patch does, but also mark them as volatile? In short, what
happens with -Wclobber and a non-optimized compilation?
--
Michael

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2022-06-02 04:36:30 Re: [PATCH] Fix pg_upgrade test from v10
Previous Message Justin Pryzby 2022-06-02 02:42:44 compiler warnings with gcc 4.8 and -Og