Unwanted error for long charconsts?

Neil Booth neil@daikokuya.demon.co.uk
Tue May 22 23:43:00 GMT 2001


Thinking of stuff like 'abcdefg' here.

The standard says:

"The *value* of an integer character constant containing more than one
character ... is implementation-defined."

We allow stuff like 'ab' as long as it fits in an int, with a warning
about multi-character charconsts if an appropriate command line option
was given.

However, if it doesn't fit in an int, we give a hard error with

"character constant too long".

In view of the wording of the standard, this seems wrong to me, and
we should downgrade the error to a warning.

Do you agree Joseph?

Neil.



More information about the Gcc mailing list