From -4861823024356937255 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f78e5,8fdf6b501ff64059 X-Google-Attributes: gidf78e5,public X-Google-ArrivalTime: 2002-01-04 15:27:03 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!dispose.news.demon.net!news.demon.co.uk!demon!mail2news.demon.co.uk!not-for-mail From: Michiel Salters Newsgroups: comp.std.c++ Subject: Re: Possible DRs Date: Fri, 4 Jan 2002 23:26:04 GMT Organization: http://www.newsranger.com Approved: Fergus Henderson , moderator of comp.std.c++ Message-ID: References: <3C36019C.32739F68@sensor.com> X-Trace: mail2news.demon.co.uk 1010186769 mail2news:19385 mail2news mail2news.demon.co.uk X-Complaints-To: abuse@demon.net X-Mail2News-Path: news.demon.net!mulga.cs.mu.oz.au X-Authentication-Warning: mulga.cs.mu.OZ.AU: fjh set sender to devnull@stump.algebra.com using -f X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov) X-Abuse-Info: When contacting newsranger.com regarding abuse please X-Abuse-Info: forward the entire news article including headers or X-Abuse-Info: else we will not be able to process your request NNTP-Posting-Date: Fri, 04 Jan 2002 18:12:48 EST X-Abuse: abuse@jtwis.com X-Added: Message sent through jtwis.com at 2002-01-04 18:13:20 Lines: 101 Xref: archiver1.google.com comp.std.c++:8821 In article <3C36019C.32739F68@sensor.com>, Ron Natalie says... > >Michiel Salters wrote: > >> >> 1) >> What's the use of the access specifier "protected:" in unions ? They >> can't be base classes anyway ? > >Not much, but do you want to add a special case for unions just because >it doesn't have a good use? Probably a QOI, yes. A warning is in order. >> 2) >> Why are the (additional) signatures of main() implementation-defined, >> while their use is undefined? What good is it to know that your >> implementation will accept a signature int main( float ); if you have >> to fear that using it will format your HD? > >Where does it say it is undefined? The idea was to allow additional >implementation defined signatures like the UNIX: > int main(int argc, char* argv[], char* env[]); >construct. Yes - but what does a program do using such a signature? A Unix compiler must document only the signature. >> 3) >> What prohibits int f( volatile void )? What does it mean, if it >> doesn't cause a program to be ill-formed? > >Ill-formed. 8.3.5 permits f(void) as a special case only in that >exact form. Yes, that's indeed the special case. But the reasoning by which volatile void is ill-formed was not obvious to me. >> 4) >> Exactly what clause of the standard outlaws the use of reserved >> keywords for other purposes ? int for; ? > >2.11 says "they are unconditionally treated as keywords in phase 7" >which means they can never be resolved gramtically to identifiers >(or any of the other types of tokens). The same is true of the >alternate operator/punctuatiior names. Makes sense. >> 5) >> Is it legal to compare addresses of objects, if these objects are >> members of different array elements? I.e. is &p[0].a < &p[1].b legal? >> Is it always true ? > >unspecified from a literal reading of 5.9. Dunno. Both are indirect part of the same arry p. >> 6) >> Pointers to members: Given >> struct A { int a } ; >> struct B : public A { }; >> struct C : public A { }; >> struct D : public B,C { }; >> D now has two members A::a, via B::A and C::A. So logically, pointers >> are unequal. But since neither one is smaller or bigger than the other, >> according to 5.9/2, what should > return ? > >D does not have any members. It has subobjects B::A and C::A each with >a member a. The results of any such comparison is unspecified (members >of different objects 5.9/2 second bulletted case). Ok. >> 7) This one is really obscure. A union can contain two members >> ( with subobjects ) such that these subobjects overlap. Is it legal >> to assign one sucg object to another? > >This is a good one. > >> Personally, I think 3) and 6) warrant DRs, but I'm not certain >> about the others. > >Actually, I think 3 and 6 are fine. 7 is the one I am concerned about. At least it's clear 1 and 4 don't matter. Regards, -- Michiel Salters Consultant Technical Software Engineering CMG Trade, Transport & Industry Michiel.Salters@cmg.nl --- [ comp.std.c++ is moderated. To submit articles, try just posting with ] [ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ] [ --- Please see the FAQ before posting. --- ] [ FAQ: http://www.research.att.com/~austern/csc/faq.html ]