public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/99340] New: [10/11 Regression] -Werror=maybe-uninitialized warning with -fPIE, but not -fPIC
@ 2021-03-02 12:04 doko at debian dot org
  2021-03-02 12:10 ` [Bug c/99340] " marxin at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: doko at debian dot org @ 2021-03-02 12:04 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 99340
           Summary: [10/11 Regression] -Werror=maybe-uninitialized warning
                    with -fPIE, but not -fPIC
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: doko at debian dot org
  Target Milestone: ---

seen building the gsequencer package.
the warning was not emitted with gcc-10 branch 20210110, but is emitted with
20210228, also emitted with trunk 20210220.

$ cat ags_midi_buffer_util.i
long ags_midi_buffer_util_seek_message_delta_time;
int ags_midi_buffer_util_seek_message_i;
int ags_midi_buffer_util_get_varlength() { return 0; }
char ags_midi_buffer_util_seek_message() {
  long current_delta_time;
  for (; ags_midi_buffer_util_seek_message_i;
       ags_midi_buffer_util_seek_message_i++) {
    ags_midi_buffer_util_get_varlength(&current_delta_time);
    ags_midi_buffer_util_seek_message_delta_time = current_delta_time;
  }
  return 0;
}

$ gcc -std=gnu99 -Wall -Werror=maybe-uninitialized -fstack-protector-strong
-fPIE -O1 -c ags_midi_buffer_util.i
ags_midi_buffer_util.i: In function 'ags_midi_buffer_util_seek_message':
ags_midi_buffer_util.i:5:8: error: 'current_delta_time' may be used
uninitialized in this function [-Werror=maybe-uninitialized]
    5 |   long current_delta_time;
      |        ^~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-04-12 19:28 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-02 12:04 [Bug c/99340] New: [10/11 Regression] -Werror=maybe-uninitialized warning with -fPIE, but not -fPIC doko at debian dot org
2021-03-02 12:10 ` [Bug c/99340] " marxin at gcc dot gnu.org
2021-03-02 12:36 ` [Bug c/99340] " rguenth at gcc dot gnu.org
2021-03-02 12:46 ` doko at debian dot org
2021-03-02 12:51 ` marxin at gcc dot gnu.org
2021-03-02 13:05 ` marxin at gcc dot gnu.org
2021-03-02 13:45 ` rguenth at gcc dot gnu.org
2021-04-12 19:28 ` msebor at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).