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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,4deb6c62a5e19f2 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-07-30 21:56:18 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!cyclone1.gnilink.net!news-east.rr.com!news-west.rr.com!lsnws01.we.mediaone.net!cyclone-LA3.rr.com!typhoon.san.rr.com.POSTED!not-for-mail Message-ID: <3B663A70.3B315EC8@san.rr.com> From: Darren New Organization: Boxes! X-Mailer: Mozilla 4.77 [en] (Windows NT 5.0; U) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: type Foo_ptr in new void*; References: <9k03jc$2me$2@news.tpi.pl> <9k0j60$n4t$1@news.tpi.pl> <3B63F48A.2E2642C6@earthlink.net> <9k2btj$5hj$1@news.tpi.pl> <3B64C26F.C195B4E0@worldnet.att.net> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Tue, 31 Jul 2001 04:56:14 GMT NNTP-Posting-Host: 24.165.21.192 X-Complaints-To: abuse@rr.com X-Trace: typhoon.san.rr.com 996555374 24.165.21.192 (Mon, 30 Jul 2001 21:56:14 PDT) NNTP-Posting-Date: Mon, 30 Jul 2001 21:56:14 PDT Xref: archiver1.google.com comp.lang.ada:10821 Date: 2001-07-31T04:56:14+00:00 List-Id: > 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.