D
David Resnick
Just curious how often people read the C standard as part of their
work in professionally writing programs. For me the answer is almost
never, I rely on my (good but not perfect) knowledge of what is valid
C backed up by my compiler with all warnings enabled. And yes, that
combination is not perfect. I do aim when writing code to produce
perfectly portable C where possible/reasonable, and where I deviate
from the standard to never do so accidentally, but rather purposefully
with the trade offs considered. I was yesterday reviewing some code
that did make me seek the standard, simplified as:
a -= b - 1;
I looked at that, and realized that I didn't know offhand whether if a
was 10 and b was 5 the result would be 6 or 4. Section 16.5.16.2
resolved that issue nicely...
n.b. I'm not trying to start a flame war, just was curious. If you
want to attack people as pedants or whatever, *please* do so
elsewhere.
-David
work in professionally writing programs. For me the answer is almost
never, I rely on my (good but not perfect) knowledge of what is valid
C backed up by my compiler with all warnings enabled. And yes, that
combination is not perfect. I do aim when writing code to produce
perfectly portable C where possible/reasonable, and where I deviate
from the standard to never do so accidentally, but rather purposefully
with the trade offs considered. I was yesterday reviewing some code
that did make me seek the standard, simplified as:
a -= b - 1;
I looked at that, and realized that I didn't know offhand whether if a
was 10 and b was 5 the result would be 6 or 4. Section 16.5.16.2
resolved that issue nicely...
n.b. I'm not trying to start a flame war, just was curious. If you
want to attack people as pedants or whatever, *please* do so
elsewhere.
-David