Chris H <> writes:
> In message <ie7r3n$ci7$>, James Kuyper
> <> writes
[...]
>>In practice, almost all
>
> So most but not all....
>
>> printf() expressions that are evaluated prior to the execution of the
>>defective code have precisely the behavior I would expect them to have,
>>as do most
>
> Again most but not all....
>
>> of the printf() statements that evaluated afterwards, so long as
> Again another caveat.
Yes, there are caveats. He said so very clearly. Why do you keep
repeating the point he's already made?
>> the program continues to run. If I don't know "how the printf got the
>>output it is giving",
>
> You don't you are assuming that the code behaved exactly as you expected
> and put the correct variable into the printf and what as in that memory
> location was the correct variable. Without a debugger you are haqve no
> idea.
>
>>that's a sign of a very serious problem of some kind - it's not at all
>>the normal case.
>
> Yes it is a common case and the fact that you have not realised that it
> does happen is the problem you don't know what you don't know.
>
> SO you are saying printf seems to work in a limited number of cases but
> you don't really know how or why.
No, he's saying that printf *does* work in the vast majority of
cases for the code that he works on. What you are asserting is "a
common case" (adding printfs drastically changing the behavior of
the program) is not a common case *for him*. It may well be a common
case for you, but not everyone works in the same environment you do.
Please pay attention, and show some respect for the fact that other
people's experiences might be valid even if they don't match yours.
--
Keith Thompson (The_Other_Keith)
kst- <http://www.ghoti.net/~kst>
Nokia
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"