This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/37200] duplicate warning message with braced initializer list


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

Eric Gallager <egallager at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2017-07-25
                 CC|                            |egallager at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #2 from Eric Gallager <egallager at gcc dot gnu.org> ---
Confirmed that gcc still prints 2 warnings for the testcase. It's necessary to
set the standard manually to c89 or gnu89 now that GCC defaults to -std=gnu11.
Now that GCC has carets for its diagnostics, we can see that the 2 warnings
actually point to different places:

$ /usr/local/bin/gcc -c -std=gnu89 -pedantic 37200.c
37200.c: In function ‘foo’:
37200.c:10:11: warning: initializer element is not computable at load time
[-Wpedantic]
   {       (void**) &x->tst }
           ^
37200.c:10:3: warning: initializer element is not computable at load time
[-Wpedantic]
   {       (void**) &x->tst }
   ^

So are they still actually duplicates?

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]