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