This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
[C/C++] same warning/error, different text
- From: "Manuel LÃpez-IbÃÃez" <lopezibanez at gmail dot com>
- To: gcc at gnu dot org
- Cc: "Joseph S. Myers" <joseph at codesourcery dot com>, "Mark Mitchell" <mark at codesourcery dot com>
- Date: Fri, 1 Dec 2006 23:32:24 +0000
- Subject: [C/C++] same warning/error, different text
The message for the following error:
enum e { E3 = 1 / 0 };
is in C: error: enumerator value for 'E3' not integer constant
and in C++: error: enumerator value for 'E3' is not an integer constant
The code in C is error ("enumerator value for %qE is not an integer
constant", name);
and in C++ is error ("enumerator value for %qD not integer constant", name);
Is there someone against fixing this? What would be the preferred message?
This arises because I am working in a patch that fixes PR28986
(overflow warnings in C++). Since currently there are not many
testcases in C++ for this (actually there are zero for the above
error), I was planning to copy the ones from the C front-end (which
are excellent and I guess they should apply to C++ most of the time).