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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,1901f265c928a511 X-Google-Attributes: gid103376,public Path: g2news1.google.com!news1.google.com!news.glorb.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newshosting.com!nx01.iad01.newshosting.com!uunet!dca.uu.net!ash.uu.net!spool.news.uu.net!not-for-mail Date: Thu, 17 Jun 2004 08:28:05 -0400 From: Hyman Rosen User-Agent: Mozilla Thunderbird 0.5 (Windows/20040502) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Typing in Ada References: <40BDBBFA.2020203@noplace.com> In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Organization: KBC Financial Products Message-ID: <1087475285.166449@master.nyc.kbcfp.com> Cache-Post-Path: master.nyc.kbcfp.com!unknown@nightcrawler.nyc.kbcfp.com X-Cache: nntpcache 3.0.1 (see http://www.nntpcache.org/) NNTP-Posting-Host: 204.253.250.10 X-Trace: 1087475285 11763 204.253.250.10 Xref: g2news1.google.com comp.lang.ada:1615 Date: 2004-06-17T08:28:05-04:00 List-Id: James Rogers wrote: > One important difference between Ada records and C structs is > in the creation of incomplete types. A C compiler allows the > creation of incomplete types under the assumption that the > type will be completed through the linking process, while an > Ada compiler must have all types completed at compile time. No, incomplete types in C have nothing to do with linking. Incomplete types are there for the same reason as in any other language, so that mutually recursive types may be declared. Eg., struct A; struct B { struct A *my_A; int x; }; struct A { struct B *my_B; int y; }; For this mutual recursion to be possible, C and C++ must then identify the places where incomplete types may be used, such as in declarations of pointers to them, or as function parameters - basically those places where knowing the innards of the type is unnecessary. It is true in C or C++ that if you never have a context in which you need the complete type, you need not supply it, even at link time.