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=0.3 required=5.0 tests=BAYES_00,INVALID_MSGID, PLING_QUERY,REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1014db,4873305131bf4d94 X-Google-Attributes: gid1014db,public X-Google-Thread: fdb77,4873305131bf4d94 X-Google-Attributes: gidfdb77,public X-Google-Thread: 103376,4873305131bf4d94 X-Google-Attributes: gid103376,public X-Google-Thread: 109fba,4873305131bf4d94 X-Google-Attributes: gid109fba,public From: fred@genesis.demon.co.uk (Lawrence Kirby) Subject: Re: How big is an int? (was: Yet another stupid language war (was: ... the only languages you need!!)) Date: 1997/11/19 Message-ID: <879900529snz@genesis.demon.co.uk>#1/1 X-Deja-AN: 290587187 References: <879381995snz@genesis.demon.co.uk> <879713346snz@genesis.demon.co.uk> X-Mail2News-User: fred@genesis.demon.co.uk X-Complaints-To: abuse@demon.net X-Mail2News-Path: genesis.demon.co.uk X-Trace: mail2news.demon.co.uk 879901549 21551 fred genesis.demon.co.uk Organization: none Reply-To: fred@genesis.demon.co.uk Newsgroups: comp.lang.ada,comp.lang.c,comp.lang.c++,comp.lang.java.advocacy Date: 1997-11-19T00:00:00+00:00 List-Id: In article Dan.Pop@cern.ch "Dan Pop" writes: >In <879713346snz@genesis.demon.co.uk> fred@genesis.demon.co.uk (Lawrence Kirby) >writes: > ># In article Dan.Pop@cern.ch "Dan Pop" writes: ># ># >In <879381995snz@genesis.demon.co.uk> fred@genesis.demon.co.uk (Lawrence > Kirby) ># > writes: ># > ># >>In article Dan.Pop@cern.ch "Dan Pop" writes:># >> ># >>... ># >> ># >>>Nope, it cannot. The behaviour of rand() is unspecified. ># >> ># >>Show me where the standard says that. If the standard doesn't say explicitly># >>that rand() has unspecified behaviour then it doesn't, as far as the ># >>standard's meaning of the term "unspecified" is concerned. > >Show me where the standard says that "unspecified behaviour" must be >*explicitly* labeled as such. "3.17 unspecified behaviour: Behaviour, for a correct program construct and correct data, for which this International Standard explicitly imposes no requirements". I might agree that the exact term "unspecified behaviour" may not be required but 3.17 makes it clear that something can't have unspecified behaviour implicitily, i.e. just because the behaviour wasn't specified in the standard. IOW the standard has positively to make something unspecified. ># >> Annex G.1, ># >>barring errors, lists all cases of unspecified behaviour in the standard. > >Annex G.1 is not part of the standard. Agreed, I think I made the point that I was just using Annex G as evidence of intent. ># >Show me where the standard specifies the behaviour of rand(), so that I ># >can predict the output of the following program without having to compile ># >and run it: ># > ># > #include ># > #incldue ># > ># > int main() ># > { ># > printf("%d\n", rand()); ># > return 0; ># > } ># > ># >If I can't do that, then the program is not strictly conforming. ># ># Sorry, you've lost me there. Where does the standard say that the output ># of a program has to be predictable for it to be strictly conforming? ># Clause 4 certaintly doesn't say anything like "A strictly conforming ># program shall not produce output dependent on anything that is not ># fully specified in this International Standard". What it says is: ># ># "A strictly conforming shall use only those features of the language and ># library specified in this International Standard. It shall not produce ># output dependent on any unspecified, undefined, or implementation-defined ># behaviour, and shall not exceed any minimum implementation limit." > >And the definition of "unspecified behaviour" is: > > * Unspecified behavior --- behavior, for a correct program construct > and correct data, for which the Standard imposes no requirements. No, the wording is as I quoted above, at least in the ISO 9899-1990 standard. >The above program seems to fit that quite well. I can find no explicit statement of unspecified behaviour for the program. -- ----------------------------------------- Lawrence Kirby | fred@genesis.demon.co.uk Wilts, England | 70734.126@compuserve.com -----------------------------------------