Re: pgsql: Fix up misuse of "volatile" in contrib/xml2. - Mailing list pgsql-committers

From Michael Paquier
Subject Re: pgsql: Fix up misuse of "volatile" in contrib/xml2.
Date
Msg-id aG85rYItyT0PGr3j@paquier.xyz
Whole thread Raw
In response to Re: pgsql: Fix up misuse of "volatile" in contrib/xml2.  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: pgsql: Fix up misuse of "volatile" in contrib/xml2.
List pgsql-committers
On Wed, Jul 09, 2025 at 11:49:55AM -0400, Tom Lane wrote:
> Not sure.  Yesterday I saw such warnings from arowana,
> boa, dhole, rhinoceros, and shelduck, eg
>
>  arowana       | 2025-07-08 04:54:18 | xpath.c:274:6: warning: 'workspace' may be used uninitialized in this function
[-Wmaybe-uninitialized]
>  arowana       | 2025-07-08 04:54:18 | xpath.c:319:6: warning: 'workspace' may be used uninitialized in this function
[-Wmaybe-uninitialized]
>  arowana       | 2025-07-08 04:54:18 | xpath.c:374:6: warning: 'workspace' may be used uninitialized in this function
[-Wmaybe-uninitialized]
>  arowana       | 2025-07-08 04:54:18 | ../../src/include/postgres.h:329:2: warning: 'result' may be used
uninitializedin this function [-Wmaybe-uninitialized] 
>
> Didn't look to try to figure out what the common factor
> among these machines is, but I think all of them are somewhat
> dated, which is depressing.  You'd hope that newer compilers
> are more likely to find such issues, not less likely.

They are all using some gcc 4.X flavor, most with -O2 but not all.

And -Wmaybe-uninitialized is included in my default switches with a
gcc 14, and there is nothing with several levels of optimizations
applied, up to -O3.  :(
--
Michael

Attachment

pgsql-committers by date:

Previous
From: Michael Paquier
Date:
Subject: pgsql: btree_gist: Merge the last two versions into version 1.8
Next
From: Aleksander Alekseev
Date:
Subject: Re: pgsql: injection_points: Add injection_points_list()