Re: pgsql: Fix up misuse of "volatile" in contrib/xml2.

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: Re: pgsql: Fix up misuse of "volatile" in contrib/xml2.
Date: 2025-07-10 03:55:25
Message-ID: aG85rYItyT0PGr3j@paquier.xyz
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: 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 uninitialized in 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

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Aleksander Alekseev 2025-07-10 10:24:48 Re: pgsql: injection_points: Add injection_points_list()
Previous Message Michael Paquier 2025-07-10 03:24:18 pgsql: btree_gist: Merge the last two versions into version 1.8