------- Comment #2 from manu at gcc dot gnu dot org  2008-08-23 12:53 -------
Andrew, how could we detect that it is a decayed array?

I think we would like to warn for 

if (a == (void *) 0) 

but not for

if ((void *)a == 0) 

or even if possible not for 

if (&a[0] == 0) 

Vincent, 
this warning was added on purpose, because probably someone requested it. I
don't see that it is very different from the documented case of using the
address of a function in a conditional.

You should be able to work-around the macro case by casting the array to (char
*) or perhaps casting to (void *) ? That said, we would like to not warn within
macros for a wide range of warnings but we don't have the infrastructure to do
that yet.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36299

Reply via email to