Email List: Xaustin-group-lX
[All Lists]

RE: [1003.1(2008)/Issue 7 0000074]: Pointer Types Problem

To: "Don Cragun" <dcragun@xxxxxxxxx>
Subject: RE: [1003.1(2008)/Issue 7 0000074]: Pointer Types Problem
From: "Wojtek Lerch" <Wojtek@xxxxxxx>
Date: Sun, 30 Aug 2009 09:01:01 -0400
Cc: <austin-group-l@xxxxxxxxxxxxx>
References: <f6e89684e7d6fc9a7b734e179e7e9c6f@austingroupbugs.net> <20090827145851.GA24688@squonk.masqnet> <9FC357E76048C74C93F3BD3D69A16B8804B62ED0@nova.ott.qnx.com> <20090829092234.GA11594@squonk.masqnet> <4A9995E2.2000506@jacaranda.org> <4A99E46C.6000807@sonic.net>
Thread-index: AcopGjDdHADDHWMtTL6sZ4ac+PEkNgAV6vEg
Thread-topic: [1003.1(2008)/Issue 7 0000074]: Pointer Types Problem
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?

<Prev in Thread] Current Thread [Next in Thread>