Technically speaking though, the compiler could see it as x+ +3, but it could equally see it as x ++3, which has two compiler errors: firstly, that's not actually a valid expression, and secondly (at least as I checked in the C99 standard, under section 184.108.40.206 on postfix increment and decrement operators) the lvalue must be modifiable.
All I guess I'm saying here is that it could technically be a typo which leads to invalid syntax, or it could be technically correct, so most compilers will treat it as a syntax error.
Someone above said that gcc was being "closer to the standard", but the standard never attempts to cover this particular corner case. So the gcc devs have done something, to my mind, quite sensible. They treat it as a possible syntax error because it could either be:
I'm more interested in how it handles x+++x; - I'd imagine that it's a syntax error. It could be:
x++ + x;
x + ++x;
x+ + +x;
The C99 standard doesn't actually explain how to handle this. Perhaps they believe you shouldn't be so daft.
I'll stand by original statement that it's a syntax error and most good compilers will treat it as such, even if it is logical to treat x++3 as x+ +3.
Edit: scratch that ALL completely. I forgot about operator precedence.
If you take x++3, then suffix increment is a higher operator than suffix decrement and addition. In other words, the compiler will always try to evaluate the expression as
In other words, it's a syntax error. It can never evaluate to x + +3, because that's at a lower operator precedence.
Thus, it's a syntax error. Take that, downvoter of my original comment.
Similar text to that C++ text is in C99 at 6.4 [Lexical elements], paragraph 4. Paragraph 6 considers the example x+++++y (which is similar to your example), noting that it is to be parsed as x ++ ++ + y. (I guess it uses distinct variables x and y to avoid any distractions due to sequence point issues -- which are immaterial here as the thing fails to parse anyway.)