This is the mail archive of the gcc@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]

Re: New gcc 4.0.0 warnings seem spurious


Zack Weinberg <zack@codesourcery.com> writes:

[...]

| >> Bruce Lilly <blilly@erols.com> writes:
| >> > static const unsigned char AAA = 0x1U;
| >> > static const unsigned char BBB = 0x2U;
| >> 
| >> Again, C does not work the way you think.  These are not constants.
| >
| > But if they are never modified, they evaluate to constants, right?
| 
| The compiler is allowed, but not required, to replace references to
| them with their known values.

Yes, however this

   enum { V = AAA };

requires a diagnostic.

-- Gaby


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