Mail Archives: djgpp/2001/10/01/07:04:18
Radical wrote:
> On Sat, 29 Sep 2001 00:28:28 GMT, CBFalconer <cbfalconer AT yahoo DOT com>
> 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.
- Raw text -