Xavier Roche <xro...@free.fr.NOSPAM.invalid> writes:
> On 01/21/2014 09:12 AM,
umesh.k...@gmail.com wrote:
>> Below code is that valid C Construct for the functions call .
>> (***(int(****)(void))test)();
>
> (valid, but does not build with -Werror and proper warnings due to
> strict aliasing issues)
>
> This is due to the "A declaration of a parameter as "function returning
> type" shall be adjusted to "pointer to function returning type"" rule,
> and the obscure 6.3.2.1 4: “A function designator is an expression that
> has function type. Except when it is the operand of the sizeof operator,
> the _Alignof operator, or the unary & operator, a function designator
> with type “function returning type” is converted to an expression that
> has type “pointer to function returning type”
The _Alignof case does not apply, since (for unclear reasons) the
_Alignof operator can be applied only to a parenthesized type name, not
to an expression. This is unlike the sizeof operator. The reference to
_Alignof (for both array and function expressions) is an error in the
N1570 draft, corrected in the released 2011 ISO C standard.
--
Keith Thompson (The_Other_Keith)
ks...@mib.org <
http://www.ghoti.net/~kst>
Working, but not speaking, for JetHead Development, Inc.
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"