https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117180

--- Comment #2 from Sam James <sjames at gcc dot gnu.org> ---
With LTO, the output is different:
```
src/feature/nodelist/networkstatus.c: In function
‘networkstatus_set_current_consensus’:
src/feature/nodelist/networkstatus.c:2145:41: warning: array subscript 2 is
above array bounds of ‘struct consensus_waiting_for_certs_t[2]’
[-Warray-bounds=]
 2145 |   waiting = &consensus_waiting_for_certs[flav];
      |                                         ^
  ‘networkstatus_set_current_consensus’: events 1-2
 2145 |   waiting = &consensus_waiting_for_certs[flav];
      |                                         ~
      |                                         |
      |                                         (2) out of array bounds here
 2146 |   if (waiting->consensus &&
      |      ^
      |      |
      |      (1) when the condition is evaluated to true
src/feature/nodelist/networkstatus.c:144:8: note: while referencing
‘consensus_waiting_for_certs’
  144 |        consensus_waiting_for_certs[N_CONSENSUS_FLAVORS];
      |        ^
```

Reply via email to