5 ms·
That is really stupid. How is that not a bug? I can't belive GCC wont compile it. What does other compilers do. Edit: Clang also gives an error. Mscv seems to
by rightbyte 7y ago
That is really stupid. How is that not a bug? I can't belive GCC wont compile it. What does other compilers do.
Edit:
Clang also gives an error. Mscv seems to compile. I wonder who follows spec. I assume not mscv ...
- _kst_ 7y agoIt's not a bug. 0xfffe+0x0001 satisfies the syntax of a "preprocessing number". In a later translation phase, preprocessing numbers are converted to numeric constants. Not all valid preprocessing numbers are valid numeric constants. The syntax of preprocessing numbers is deliberately permissive to avoid complicating the implementation of the preprocessor. I'm sure it could have been made stricter, allowing 0xfffe+0x0001 to be treated as 0xfffe + 0x0001 -- but the solution is simply to write 0xfffe + 0x0001 in the first place. The language grammar has to be consistently defined even if it leads to surprises now and then.