Re: New compiler warnings in buildfarm - Mailing list pgsql-hackers

From Tom Lane
Subject Re: New compiler warnings in buildfarm
Date
Msg-id 4001633.1722625252@sss.pgh.pa.us
Whole thread Raw
In response to Re: New compiler warnings in buildfarm  (Peter Eisentraut <peter@eisentraut.org>)
List pgsql-hackers
Peter Eisentraut <peter@eisentraut.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



pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: [PoC] Federated Authn/z with OAUTHBEARER
Next
From: Masahiko Sawada
Date:
Subject: Fix memory counter update in reorderbuffer