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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f5d71,d275ffeffdf83655 X-Google-Attributes: gidf5d71,public X-Google-Thread: 103376,d275ffeffdf83655 X-Google-Attributes: gid103376,public X-Google-Thread: 146b77,d275ffeffdf83655 X-Google-Attributes: gid146b77,public X-Google-Thread: 109fba,d275ffeffdf83655 X-Google-Attributes: gid109fba,public From: ark@research.att.com (Andrew Koenig) Subject: Re: Ada vs C++ vs Java Date: 1999/02/05 Message-ID: #1/1 X-Deja-AN: 441063357 Sender: nntp@research.att.com X-Nntp-Posting-Host: raptor.research.att.com References: <369C1F31.AE5AF7EF@concentric.net> <79ce4s$lfq$1@nnrp1.dejanews.com> <79chc7$ko6@drn.newsguy.com> <36BAF083.6C413B3D@acenet.com.au> Organization: AT&T Research, Florham Park, NJ Newsgroups: comp.lang.ada,comp.lang.c++,comp.vxworks,comp.lang.java Date: 1999-02-05T00:00:00+00:00 List-Id: In article <36BAF083.6C413B3D@acenet.com.au>, Geoff Bull wrote: > > C++ now, after becoming a standard, and with the standard library is a > > very safe language. > Not quite! > $ cat rat.c > #include > int* one () {return &(1);} > int* two () {return &(2);} Rest of program snipped, because this is enough to prove my point. > One C compiler I used issued a warning, the other didn't. Any compiler that accepts the above program is broken. Neither 1 nor 2 is an lvalue, so you can't take the address of either one. A conforming C compiler is required to issue a diagnostic message for such a program. Moreover, this posting talked about C compilers, not C++ compilers. How a statement of the form ``Some C compilers have bugs in them'' can possibly gainsay a statement about the C++ standard library is beyond my comprehension. -- Andrew Koenig ark@research.att.com http://www.research.att.com/info/ark