Mail Archives: djgpp/1997/08/15/02:38:09
Erik Max Francis wrote:
>
>
> These compilers didn't even conform to traditional C, then.
>
> --
The original question that started this round:
if (first() && second() && third())
(etc)
How critical is your application, and how much interaction is there
between the functions in question?
Of course, I live a rather charmed existence. I've never had to read
the 30 page section of a compiler manuel listing, "Differences from
Traditional C", "Differences from ANSI C", and "Differences from K&R
C." Yep, since ANSI says it. It must be so.
I, for one, am glad that I live here in NJ, USA, where cocaine is
illegal. I can sleep soundly knowing that no one is using illegal drugs
in my neighborhood, since they've been banned. Yep. Really makes me
feel secure, being free from crack heads.
On the other hand, I could test my application, using my data, on my
platform, and see what the results are. This enables me to do two
things:
1. Get my project done on time and under budget.
2. Get my users (who also need to write code) up to speed on the quirks
of the compiler so they can get their work done on time and under
budget.
Broken && || evaluation isn't something you'd catch every time, unlike,
say, the increment operator. How often do we write logicals that rely
on complex function interactions, rather than something that works out
to:
if ((a==1) && (b==1) && (c==1))
If that works correctly, as it likely does, it might not occur to most
of us to look for trouble in the evaluation of the more complex case,
given in the original post.
--
Charles Krug, Jr.
- Raw text -