From: Hans-Bernhard Broeker Newsgroups: comp.os.msdos.djgpp Subject: Re: Please add strrev proposal Date: 1 Oct 2001 10:56:09 GMT Organization: Aachen University of Technology (RWTH) Lines: 38 Message-ID: <9p9i49$gvu$1@nets3.rz.RWTH-Aachen.DE> References: <3BB50884 DOT 347A4384 AT yahoo DOT com> NNTP-Posting-Host: acp3bf.physik.rwth-aachen.de X-Trace: nets3.rz.RWTH-Aachen.DE 1001933769 17406 137.226.32.75 (1 Oct 2001 10:56:09 GMT) X-Complaints-To: abuse AT rwth-aachen DOT de NNTP-Posting-Date: 1 Oct 2001 10:56:09 GMT Originator: broeker@ To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Radical wrote: > On Sat, 29 Sep 2001 00:28:28 GMT, CBFalconer > wrote: >>> C:\var>gcc djstrrev.c -o djstrrev.exe -O2 -Wall >>> >>> C:\var>djstrrev >>> Original String: .tset a si sihT >>> Reversed String: .tset a si sihT > If your compiler actually outputs both strings as reversed, > THEN I am very scared your compiler is quite BROKEN. No, it's not. Your idea of how a C compiler is supposed is broken, instead. Actually, any compiler *not* outputting two identical strings, in this particular situation, would have to be called broken. > printf("format specifier1, format_specififer2", var1, func1); > > does: > display __current__ value of var1 FIRST using format_specifier1, > __THEN__ > display __output__ of funct1 using format_specifier2, No. What this code does, according the definition of C, is: 1)a) evaluate expression 'var1' 1)b) evaluate expression 'func1' 2) call printf There is no specification whatsoever about the order in which 1a) and 1b) happen, in the C standard, only that both must have been finished, before printf() is called. They may even be done simultaneously, as far as the standard is concerned. -- Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de) Even if all the snow were burnt, ashes would remain.