Re: Fix last unitialized memory warning

From: Andres Freund <andres(at)anarazel(dot)de>
To: Peter Eisentraut <peter(at)eisentraut(dot)org>
Cc: Tristan Partin <tristan(at)neon(dot)tech>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Fix last unitialized memory warning
Date: 2023-07-06 19:15:26
Message-ID: 20230706191526.h4hpb26gnmzezpmp@awork3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On 2023-07-06 10:21:44 +0200, Peter Eisentraut wrote:
> On 05.07.23 23:06, Tristan Partin wrote:
> > Thanks for following up. My system is Fedora 38. I can confirm this is
> > still happening on master.
> >
> > $ gcc --version
> > gcc (GCC) 13.1.1 20230614 (Red Hat 13.1.1-4)
> > Copyright (C) 2023 Free Software Foundation, Inc.
> > This is free software; see the source for copying conditions. There is NO
> > warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
> > $ meson setup build --buildtype=release
>
> This buildtype turns on -O3 warnings. We have usually opted against chasing
> warnings in -O3 level because there are often some false-positive
> uninitialized variable warnings with every new compiler.

OTOH, -O3 is substantially faster IME in cpu bound tests than -O2. It doesn't
seem wise to me for the project to basically say that that's not advisable due
to the level of warnings created.

I've also found bugs with -O3 that -O2 didn't find. And often -O3 warnings end
up showing up with -O2 a compiler major version or three down the line, so
it's often just deferring work.

Greetings,

Andres Freund

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Gurjeet Singh 2023-07-06 19:19:42 Re: [PATCH] Add GitLab CI to PostgreSQL
Previous Message Gurjeet Singh 2023-07-06 19:06:20 Re: Avoid unncessary always true test (src/backend/storage/buffer/bufmgr.c)