home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / lang / cplus / 13613 < prev    next >
Encoding:
Text File  |  1992-09-14  |  1.2 KB  |  34 lines

  1. Newsgroups: comp.lang.c++
  2. Path: sparky!uunet!ftpbox!motsrd!news
  3. From: shang@corp.mot.com (David (Lujun) Shang)
  4. Subject: Re: zero-length datatype
  5. Message-ID: <1992Sep14.133224.6301@cadsun.corp.mot.com>
  6. Sender: news@cadsun.corp.mot.com
  7. Reply-To: shang@corp.mot.com
  8. Organization: Motorola, Inc., Software Research and Development, Rolling Meadows, IL. 60008
  9. References: <TMB.92Sep12212544@arolla.idiap.ch>
  10. Distribution: comp
  11. Date: Mon, 14 Sep 92 13:32:24 GMT
  12. Lines: 20
  13.  
  14. In article <TMB.92Sep12212544@arolla.idiap.ch> tmb@arolla.idiap.ch (Thomas M.  
  15. Breuel) writes:
  16. > In article <23654@alice.att.com> ark@alice.att.com (Andrew Koenig) writes:
  17. >    In article <1992Sep10.181836.9929@cadsun.corp.mot.com> shang@corp.mot.com  
  18. writes:
  19. >    > Note that C g++ implements empty struct or class with size of zero. 
  20. >    > g++ also allows an array with zero number of member with size of zero.
  21. >    Unfortunately, this violates the ISO C standard, which explicitly says
  22. >    that there are no zero-size objects.
  23. > I think Shang's claim is false. GNU C++ 2.2.2 reserves at least 1 byte
  24. > for the empty structure.
  25.  
  26. The GNU C++ installed on my computer says that "sizeof(EmptyStruct)==0". It's a  
  27. version lower that 2.2.2 of cause.
  28.  
  29.