This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Unwanted error for long charconsts?


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]