null pointers
Posted Mar 19, 2008 20:20 UTC (Wed) by
vmole (guest, #111)
In reply to:
null pointers by quotemstr
Parent article:
Who maintains dpkg?
You assume that cars will stop at red lights
when you cross the street, don't you?
You obviously don't live in Houston. I'd be dead if I was that
careless. (No smiley.)
You assume that a char has eight bits, don't you?
No, why would I? Sure, that's the most common situation, but if I'm actually coding something that requires that (unusual), then I check. Now, I admit that I probably would just error-out, rather than spend the time coding
for the unusual situation until I actually needed it.
Sure, we all make assumptions when we have to. But why make an assumption when you can just as easily follow the standard? If you're coding to POSIX, and POSIX really does imply that null-pointer types are all interchangeable, then fine. But the code isn't C standard compliant, and I've spent way too much of my life fixing code full of assumptions about platforms and compilers to have much positive to say about code that doesn't follow appropriate standards.
(
Log in to post comments)