sac2c does not believe in all integers. Perhaps a Roman Numeral compatability feature?
|
|
Bugzilla Link |
438 |
Created on |
Jun 19, 2008 22:55 |
Resolution |
INVALID |
Resolved on |
Jun 20, 2008 12:41 |
Version |
1.00beta |
OS |
Linux |
Architecture |
PC |
Extended Description
This program does not compile in sac2c:
int main()
{
return(-2147483648);
}
sac2c complains that the value can not be represented as an integer.
Actually, it complains that 2147483648 can not be represented
as an integer, which is certainly true in a 32-bit system.
However, there should be a way to enter negative constants
into a program.
A few possible fixes are:
- fix the parser/scanner so that it properly handles negative
constants.
- kludge the scanner to check for this exact case. Yuck.
- Adopt a way to represent negative constants that does not
confuse the negation function with the sign of a constant.
In J, for example, this is done this way: _214783648.
This neatly avoids the function/sign confusion.