This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/71597] New: Confusing warning for incompatible enums
- From: "ch3root at openwall dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 20 Jun 2016 17:53:28 +0000
- Subject: [Bug c/71597] New: Confusing warning for incompatible enums
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71597
Bug ID: 71597
Summary: Confusing warning for incompatible enums
Product: gcc
Version: 7.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: ch3root at openwall dot com
Target Milestone: ---
Source code:
----------------------------------------------------------------------
enum { a } x; // (1)
unsigned x; // (2)
enum { b } x; // (3)
int main()
{
}
----------------------------------------------------------------------
Results:
----------------------------------------------------------------------
$ gcc -std=c11 -pedantic -Wall -Wextra -O3 test.c && ./a.out
test.c:3:12: error: conflicting types for âxâ
enum { b } x; // (3)
^
test.c:2:10: note: previous declaration of âxâ was here
unsigned x; // (2)
^
----------------------------------------------------------------------
gcc version: gcc (GCC) 7.0.0 20160616 (experimental)
It would be better to display the conflicting declaration (1) instead of just
the previous one (2).