This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/61162] New: possibly bad error location with -Wc++-compat
- From: "tromey at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 13 May 2014 03:36:58 +0000
- Subject: [Bug c/61162] New: possibly bad error location with -Wc++-compat
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61162
Bug ID: 61162
Summary: possibly bad error location with -Wc++-compat
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: tromey at gcc dot gnu.org
Consider this source:
enum e { ZERO = 0, ONE };
enum e e_val;
void f(void)
{
e_val = 0;
}
Compile with -Wc++-compat:
bapiya. gcc -Wc++-compat --syntax-only r.c
r.c: In function âfâ:
r.c:7:3: warning: enum conversion in assignment is invalid in C++
[-Wc++-compat]
e_val = 0;
^
I think perhaps using the location of the "=" would be preferable.