From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,1e82cb45ab839370 X-Google-Attributes: gid103376,public From: Keith Thompson Subject: Re: Interfaces.C and void * Date: 1999/09/22 Message-ID: #1/1 X-Deja-AN: 528337989 Sender: kst@king.cts.com References: <87btavxw93.fsf@deneb.cygnus.argh.org> X-Trace: thoth.cts.com 938027288 62425 198.68.168.21 (22 Sep 1999 19:08:08 GMT) Organization: CTS Network Services Newsgroups: comp.lang.ada X-Complaints-To: newsmaster@cts.com Date: 1999-09-22T00:00:00+00:00 List-Id: Florian Weimer writes: [...] > Is there really no portable equivalent of a C void * in Interfaces.C? > I used Interfaces.C.Strings.chars_ptr, which should be quite portable in > practice, but AFAIK, ISO C doesn't require the representation of void * > and char * to be identical. Yes, it does. ANSI/ISO 9899-1990, section 6.1.2.5, says: A pointer to void shall have the same representation and alignment requirements as a pointer to a character type. Similarly, pointers to qualified or unqualified versions of compatible types shall have the same representation and alignment requirements. [Footnote: The same representation and alignment requirements are meant to imply interchangeability as arguments to functions, return values from functions, and members of unions.] Pointers to other types need not have the same representation and alignment requirements. Yes, a void_ptr type would be a good addition to Interfaces.C. -- Keith Thompson (The_Other_Keith) kst@cts.com San Diego Supercomputer Center <*> "Oh my gosh! You are SO ahead of your time!" -- anon.