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/58953] New: Unhelpful error message in conflict between enum and #define


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58953

            Bug ID: 58953
           Summary: Unhelpful error message in conflict between enum and
                    #define
           Product: gcc
           Version: 4.8.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: michael at talamasca dot ocis.net

Consider the following invalid C code:

#define FALSE 0
#define TRUE 1

enum {FALSE = 0, TRUE = 1} BOOL;

Given in a single file, GCC produces a meaningful error message citing both one
of the #defines and the enum state.

However, if the #defines are in a system header, then the error message will
only cite the enumeration.  This can be confusing -- it's not obvious the
compiler is really seeing "{0 = 0, 1 = 1}". 

This case happens in real life, if the current version of libtiff (4.0.3) is
compiled against the current version of libjpeg (v9).


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