From: Darren New <dnew@san.rr.com>
Subject: Re: type Foo_ptr in new void*;
Date: Tue, 31 Jul 2001 04:56:14 GMT
Date: 2001-07-31T04:56:14+00:00 [thread overview]
Message-ID: <3B663A70.3B315EC8@san.rr.com> (raw)
In-Reply-To: 3B64C26F.C195B4E0@worldnet.att.net
> You can even create an array
> of Foo *. However, pointer arithmetic from the start of this array
> produces unspecified behavior.
Errrr, no it doesn't.
> What is the sizeof Foo?
Irrelevant, if you have an array of Foo*. If you have an array of Foo,
it's relevant.
> Since it is
> undefined, there is no correct answer to that question. Without a
> proper definition of the sizeof Foo, there can be no reliable pointer
> arithmetic.
Right. That's why you can't do pointer arithmetic on a Foo* without
defining Foo.
Which is not to say that Ada isn't superior to C in this respect.
But what do you think a compiler is going to do if you index an array of
Foo without defining Foo? Just randomly make up a sizeof(Foo) from whole
cloth? There's probably something in the standard about this.
--
Darren New / Senior MTS & Free Radical / Invisible Worlds Inc.
San Diego, CA, USA (PST). Cryptokeys on demand. dnew@san.rr.com
Only a WIMP puts wallpaper on his desktop.
next prev parent reply other threads:[~2001-07-31 4:56 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-07-29 4:31 type Foo_ptr in new void*; Tomasz Wegrzanowski
2001-07-29 5:56 ` tmoran
2001-07-29 8:57 ` Tomasz Wegrzanowski
2001-07-29 12:26 ` Marc A. Criley
2001-07-30 1:05 ` Tomasz Wegrzanowski
2001-07-30 1:20 ` tmoran
2001-07-30 2:09 ` James Rogers
2001-07-30 2:36 ` Warren W. Gay VE3WWG
2001-07-30 3:10 ` James Rogers
2001-07-31 2:14 ` Warren W. Gay VE3WWG
2001-07-31 1:21 ` Tomasz Wegrzanowski
2001-07-31 3:06 ` James Rogers
2001-07-31 5:02 ` Warren W. Gay VE3WWG
2001-07-31 7:22 ` Florian Weimer
2001-07-31 4:56 ` Darren New [this message]
2001-08-04 6:05 ` David Thompson
2001-08-05 2:27 ` Warren W. Gay VE3WWG
2001-07-29 13:40 ` Dale Stanbrough
2001-07-29 14:12 ` Florian Weimer
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox