[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: bug in gcc?
- From: roberto@... (Roberto Ierusalimschy)
- Date: Wed, 4 Apr 2007 15:25:56 -0300
> The literal 0 (and NULL, which is defined to be 0) is explicitly
> comparable and assignable to a pointer, even in C++ (test1.cc), so I
> don't think its correct to say 0 is of type int.
>
> Unlike 0, the result of a comma expression has a type, int in this
> case, and int cannot be assigned to a pointer in C++, or without
> warnings in C (test2.cc), not sure if its a bug. Of course, test3.cc
> is plainly not legal.
That makes sense. What surprised me is that the construction does not
generate even a warning in C.
Many thanks for all answers.
-- Roberto