Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
C Programming
Deferencing void pointer
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
Reply to thread
Message
[QUOTE="Richard Heathfield, post: 1689698"] It doesn't matter to the compiler (*provided* you don't mis-type). And it doesn't matter from a logical perspective. And it matters hardly at all to the reader. So I see no reason not to take advantage of this (slight) gain. Yes, the subtle error (and it /is/ a subtle error, since it can be very hard to track down) can be trivially avoided by perfect C programmers. Trouble is, I've never met one. Not at all. I can share what I know, even if I don't know everything. No. It didn't occur to me that it would be necessary. And the feedback I've had on the book from language experts suggests that I didn't make too bad a job of it, so the omission appears to have done no harm. Neither was I. Presumably, you mean "take much longer to write a comparison of a constant against a variable than I currently take". Alas, no - it is certainly possible to triple-check something and still not notice an error (either one's own error or someone else's, in peer review). Of course. But it's not foolproof. (There's a one-liner feed for you...) On the contrary, it prevents bugs. And if I do the checking myself /and/ "help" the compiler, I get the best of both worlds. When I'm unconscious, I'm very careless indeed. Of course. All the more reason to use every possible means to catch errors. Well, I can see that this argument is pointless, if that's what you mean. [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
C Programming
Deferencing void pointer
Top