Re: New compiler warnings in buildfarm

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter(at)eisentraut(dot)org>
Cc: Andres Freund <andres(at)anarazel(dot)de>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: New compiler warnings in buildfarm
Date: 2024-08-02 19:00:52
Message-ID: 4001633.1722625252@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Peter Eisentraut <peter(at)eisentraut(dot)org> writes:
> On 31.07.24 20:39, Andres Freund wrote:
>> I Wonder if I should also should add -Wno-clobbered to serinus' config. Afaict
>> -Wclobbered is pretty useless once optimizations are used. I've long added
>> that to my local dev environment flags because it's so noisy (which is too
>> bad, in theory a good warning for this would be quite helpful).

> It's unclear to me what to make of this. We have in the past fixed a
> number of these, IIRC, and clearly in theory the risk that the warning
> points out does exist. But these warnings appear erratic and
> inconsistent. I'm using the same compiler versions but I don't see any
> of these warnings. So I don't understand exactly what triggers these.

Yeah, -Wclobbered's results seem to vary quite a lot across different
compiler versions and perhaps different compiler options. I'd be more
excited about trying to silence it if there were some consistency to
the reports, but there's not that much; plus, we've never seen any
evidence that the reports from the noisier compilers correspond to
real bugs.

Just for context, here's a quick count of -Wclobbered warnings in
the buildfarm:

71 calliphoridae
66 canebrake
71 culicidae
67 grassquit
65 serinus
89 skink
66 taipan
68 tamandua

The other hundred-plus animals report zero such warnings.

I also tried slicing the data by the variable being complained of:

$ grep 'Wclobbered' currentwarnings | sed -e 's/.*: argument //' -e 's/.*: variable //' | awk '{print $1}' | sort | uniq -c

118 '_do_rethrow'
24 '_do_rethrow2'
8 'arrayname'
6 'bump_level'
1 'cell__state'
7 'commandCollected'
8 'commands'
3 'cstr'
6 'cur_datname'
6 'cur_nspname'
6 'cur_relname'
7 'data'
2 'dboid'
8 'dbstrategy'
8 'elevel'
14 'error'
1 'fd'
8 'found_concurrent_worker'
4 'ft_htab'
8 'has_pending_wal'
8 'ib'
8 'import_collate'
8 'import_default'
8 'import_generated'
8 'import_not_null'
1 'is_program'
1 'iter'
8 'loop_body'
8 'method'
6 'named_arg_strings'
7 'nulls'
5 'objname'
1 'options'
7 'params'
8 'primary'
8 'processed'
8 'rel'
8 'relations'
8 'relids_logged'
8 'reltuples'
44 'result'
8 'retry'
17 'retval'
16 'rv'
6 'seq_relids'
8 'sqlstate'
8 'stats'
3 'success'
8 'switch_lsn'
8 'switch_to_superuser'
8 'sync_slotname'
5 'tab'
7 'table_oids'
8 'tb'
6 'update_failover'
2 'update_tuple'
8 'update_two_phase'
8 'vob'

That shows that the apparent similarity of the total number of reports
per animal is illusory: there are some that all eight animals agree
on, but a lot where they don't.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Masahiko Sawada 2024-08-02 19:50:54 Fix memory counter update in reorderbuffer
Previous Message Peter Eisentraut 2024-08-02 18:48:40 Re: [PoC] Federated Authn/z with OAUTHBEARER