This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Inconsistent error/pedwarn: ISO C++
- From: "Manuel López-Ibáñez" <lopezibanez at gmail dot com>
- To: "Doug Gregor" <doug dot gregor at gmail dot com>
- Cc: GCC <gcc at gcc dot gnu dot org>
- Date: Mon, 24 Sep 2007 15:09:10 +0100
- Subject: Re: Inconsistent error/pedwarn: ISO C++
- References: <24b520d20709200417s381199c5x6ac1551838f59e48@mail.gmail.com>
On 20/09/2007, Doug Gregor <doug.gregor@gmail.com> wrote:
> We can't seem to decide whether ISO C++ really forbids comparisons
> between pointers and integers or not. The first two are for == and !=,
> the second two are for <, >, <=, >=. Why the inconsistency?
>
> typeck.c: error ("ISO C++ forbids comparison between pointer
> and integer");
> typeck.c: error ("ISO C++ forbids comparison between pointer
> and integer");
> typeck.c: pedwarn ("ISO C++ forbids comparison between
> pointer and integer");
> typeck.c: pedwarn ("ISO C++ forbids comparison between
> pointer and integer");
>
Open a PR and CC Gabriel. I am sure he will give his opinion as soon
as he has free time. Otherwise, this may get forgotten. As I guess, I
think that if ISO C++ forbids the comparison, this should be a
pedwarn. On the other hand, this may be some special case as these
ones:
cd ~/src/trunk/gcc/cp/
grep -n -e "error (.*ISO C\+\+" *.c /dev/null
decl.c:4232: error ("ISO C++ forbids use of initializer list to "
decl.c:6835: error ("ISO C++ forbids in-class initialization of non-const "
decl.c:9753: error ("ISO C++ prohibits overloading operator ?:");
typeck.c:3360: error ("ISO C++ forbids comparison between pointer
and integer");
typeck.c:3365: error ("ISO C++ forbids comparison between pointer
and integer");
typeck.c:5575: error ("ISO C++ forbids casting to an array type %qT", type);
Cheers,
Manuel.