J
James Brown
All,
this is a bit of an odd question but please bear with me:
Suppose I have the following (bad) C expression:
unsigned int x = 0xABCDEFg;
Note the illegal 'g' at the end of the hex-literal. My question is, what
would the expected behavior of an ANSI-C compiler be in this case? I would
expect it either to say something along the lines of "illegal suffix on
number 0xABCDEF" or "unexpected identifier 'g' "
Is there an expected, 'correct' way for the compiler to deal with this
scenario? In other words, if I was writing a simple C-parser (which I am),
what would be the proper way to deal with this?
thanks,
James
this is a bit of an odd question but please bear with me:
Suppose I have the following (bad) C expression:
unsigned int x = 0xABCDEFg;
Note the illegal 'g' at the end of the hex-literal. My question is, what
would the expected behavior of an ANSI-C compiler be in this case? I would
expect it either to say something along the lines of "illegal suffix on
number 0xABCDEF" or "unexpected identifier 'g' "
Is there an expected, 'correct' way for the compiler to deal with this
scenario? In other words, if I was writing a simple C-parser (which I am),
what would be the proper way to deal with this?
thanks,
James