jacob said:
Francois Grieu a �crit :
I think that is incorrect. Lcc-win gave that diagnostic before
the correction I did this morning.
If the correction causes "0xE-2" to be parsed the same as if it were
"0xE - 2", then it renders your compiler non-conforming.
If there is some obscure specs that make 0xE-2 a "pp-number",
Did you bother reviewing how the standard specifies pp-number before
posting that message? It's right there, in precisely the most obvious
place to look for the definition of a pp-number: 6.4.8p1. Knowing that
you need to look for the definition of pp-number, rather than the
definition of an integer constant, is the tricky part of this issue.
it is plain wrong.
It would be a bug in the specs
The committee's decision to simplify the specification of pp-number by
allowing it to match things that are not actual numeric constants was
deliberate, not an accident. You have every right to disagree with
that decision, but if you care to convince them that it was a bad
decision, you had better fully understand the reasons they had for
making it.
The C Rationale says: "In the interests of keeping the description
simple, occasional spurious forms are scanned as preprocessing
numbers. For example, 0x123E+1 is a single token under the rules. The
C89 Committee felt that it was better to tolerate such anomalies than
burden the preprocessor with a more exact, and exacting, lexical
specification. It felt that this anomaly was no worse than the
principle under which the characters a+++++b are tokenized as a ++ ++
+ b (an invalid expression), even though the tokenization a ++ + ++ b
would yield a syntactically correct expression. In both cases,
exercise of reasonable precaution in coding style avoids surprises."