This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Unwanted error for long charconsts?
- To: gcc at gcc dot gnu dot org
- Subject: Unwanted error for long charconsts?
- From: Neil Booth <neil at daikokuya dot demon dot co dot uk>
- Date: Wed, 23 May 2001 07:43:06 +0100
- Cc: "Joseph S. Myers" <jsm28 at cam dot ac dot uk>
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.