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/61162] New: possibly bad error location with -Wc++-compat


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.

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