home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / lang / cplus / 13566 < prev    next >
Encoding:
Internet Message Format  |  1992-09-12  |  1.1 KB

  1. Path: sparky!uunet!snorkelwacker.mit.edu!ai-lab!life.ai.mit.edu!tmb
  2. From: tmb@arolla.idiap.ch (Thomas M. Breuel)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: zero-length datatype
  5. Message-ID: <TMB.92Sep12212544@arolla.idiap.ch>
  6. Date: 13 Sep 92 01:25:44 GMT
  7. References: <1992Sep10.003726.27140@lucid.com> <1992Sep10.181836.9929@cadsun.corp.mot.com>
  8.     <23654@alice.att.com>
  9. Sender: news@ai.mit.edu
  10. Reply-To: tmb@idiap.ch
  11. Distribution: comp
  12. Organization: IDIAP (Institut Dalle Molle d'Intelligence Artificielle
  13.     Perceptive)
  14. Lines: 14
  15. In-reply-to: ark@alice.att.com's message of 11 Sep 92 13:50:56 GMT
  16.  
  17. In article <23654@alice.att.com> ark@alice.att.com (Andrew Koenig) writes:
  18.  
  19.    In article <1992Sep10.181836.9929@cadsun.corp.mot.com> shang@corp.mot.com writes:
  20.  
  21.    > Note that C g++ implements empty struct or class with size of zero. 
  22.    > g++ also allows an array with zero number of member with size of zero.
  23.  
  24.    Unfortunately, this violates the ISO C standard, which explicitly says
  25.    that there are no zero-size objects.
  26.  
  27. I think Shang's claim is false. GNU C++ 2.2.2 reserves at least 1 byte
  28. for the empty structure.
  29.  
  30.                     Thomas.
  31.