Don Cragun wrote:
> David-Sarah Hopwood wrote:
>> Huh? Of course it is possible for an interpretation containing
mistakes,
>> such as this one about C99, to be approved.
>>
>> C99 *never* requires warnings. It sometimes requires "diagnostics"
>> (when "shall" conformance language is used in a constraint clause),
>> but it never distinguishes between warnings and errors.
>
> This is just a difference in terminology between the C and POSIX
> standards. In C a diagnostic is required as you has been described by
> you and Fred.
Excuse me? Neither David-Sarah Hopwood nor Fred J. Tydeman demonstrated
that casting void* to a function pointer is a constraint violation. Or
have I perhaps missed it?
Here's the Constraints section of the cast operator (6.5.4):
<quote>
2 Unless the type name specifies a void type, the type name shall
specify qualified or unqualified scalar type and the operand shall have
scalar type.
3 Conversions that involve pointers, other than where permitted by the
constraints of 6.5.16.1, shall be specified by means of an explicit
cast.
<end quote>
Since all pointers are scalar types (according to the definition in
6.2.5#21), the cast in question does not violate these constraints, does
it? Is there some other constraint it does violate that I missed?
|