On 20/09/2007, Doug Gregor <[EMAIL PROTECTED]> 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.

Reply via email to