23 Oct
2007
23 Oct
'07
6:09 p.m.
On Sat, Oct 20, 2007 at 11:12:10AM +0200, Alexandre Julliard wrote:
Michael Stefaniuc <mstefani(a)redhat.com> writes:
Actually it's not a cast. It's a heuristic that the compiler has to make to detect a NULL pointer. The best heuristic for this is (char *) 0.
(char *)0 is bad, 0 is ok, as is (void *)0
There's no heuristic involved here, the assignment is clearly to a pointer, and 0 is a perfectly valid null pointer, no cast is needed.
As is 1-1, or any other compile time integer expression with a numeric vaule of zero. David -- David Laight: david(a)l8s.co.uk