comp.lang.ada
 help / color / mirror / Atom feed
From: Keith Thompson <kst@cts.com>
Subject: Re: Interfaces.C and void *
Date: 1999/09/22
Date: 1999-09-22T00:00:00+00:00	[thread overview]
Message-ID: <yeck8piix2g.fsf@king.cts.com> (raw)
In-Reply-To: 87btavxw93.fsf@deneb.cygnus.argh.org

Florian Weimer <fw@deneb.cygnus.argh.org> 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  <http://www.ghoti.net/~kst>
San Diego Supercomputer Center           <*>  <http://www.sdsc.edu/~kst>
"Oh my gosh!  You are SO ahead of your time!" -- anon.




      parent reply	other threads:[~1999-09-22  0:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-09-22  0:00 Interfaces.C and void * Florian Weimer
1999-09-22  0:00 ` Ted Dennison
1999-09-22  0:00 ` Tucker Taft
1999-09-22  0:00 ` Keith Thompson [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox