C++ PATCH: Fix PR/7363, a regression

Neil Booth neil@daikokuya.co.uk
Sun Jul 21 01:45:00 GMT 2002


Gabriel Dos Reis wrote:-

> !   if (type_code == FUNCTION_TYPE)
>       {
> !       if (op == SIZEOF_EXPR && (pedantic || warn_pointer_arith))
> ! 	{
> ! 	  pedwarn ("invalid application of `sizeof' to a function type");
> ! 	  value = size_one_node;
> ! 	}
> !       else
> ! 	value = size_int (FUNCTION_BOUNDARY / BITS_PER_UNIT);

This code implies that the result of "sizeof" depends on -pedantic or
-Wpointer-arith, which IMO is not a good idea.

Shouldn't the && part be taken inside the braces?

Neil.



More information about the Gcc-patches mailing list