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
Null pointers
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
Reply to thread
Message
[QUOTE="Michael Wojcik, post: 2382532"] No one (unless it's someone I've killfiled) in this thread is baiting you. They're pointing out, in explicit and excruciating detail, how and why you're wrong - wrong about the facts of the C language, and wrong to advocate a change to the language. If you feel you're being baited, that's your problem, not ours. You're certainly ignorant about many C implementations - probably the majority of implementations, which are freestanding ones for embedded processors. If you haven't read the standard, then you're ignorant about how the C language is actually defined. And while you claim you've read K&R2, you apparently don't understand the difference between the tutorial portions and the language specifi- cation in the appendix, nor do you show an understanding of what's contained in the latter. I expect everyone else interpreted the passage in question either in accordance with the standard (that is, that a zero pointer constant never refers to a valid object), or misinterpreted it in the common way (that is, believing that the all-bits-zero address is the same as a null pointer). Your apparent novelty is in believing that the authors intended to make the all-bits-zero address forbidden in all C implementations, and the standard committee somehow neglected to honor this desire. It's known to be wrong on various points. See Dennis Ritchie's own list of errata, the link to which has been posted in this very thread. It's an incorrect, or at least misleading, sentence that the committee wisely chose to ignore, since that would have broken existing implemen- tations and made (standard) C unusable on a wide range of platforms. That seems like an excellent purpose. No, because there isn't one, if Keith is correct and this is a novel misconception on your part. I've yet to see anyone in this thread be particularly fierce. Even the more aggressive c.l.c regulars are being remarkably restrained. And, of course, they're arguing against your proposal because it's a terrible idea - it would break existing implementations and make standard C unusable on a wide range of platforms. (Repeat that to yourself until you get it.) How would this be relevant? Let's see: you're incorrect about the existing definition and how it's established; you're advocating a change to the language that would reduce its utility for no benefit; you're complaining of persecution... What would you call it? At least one poster (Jack Klein, IIRC) has recently noted that he's worked on systems where location zero is a valid address. I believe that was in this thread. Try it on an older VAX VMS C implementation, and you'll find a zero there. Because some old C programs relied on this, there are more recent implementations which support the "zero-address hack" as an option - an option which does NOT render them non-conforming. IBM's C for AIX had this option (actually implemented by the linker); I don't know if it still does, but I have a machine sitting around with a sufficiently old version of AIX to still provide it. And we're stating that your opinion is wrongheaded, since making address all-bits-zero invalid on all platforms would be a bad idea. Besides the two hosted implementations I mentioned above, there are many freestanding implementations - as Jack Klein HAS ALREADY NOTED - which put something useful at address all-bits-zero. Embedded processors *greatly* outnumber general-purpose processors. Many of those embedded processors have freestanding C implementa- tions, and there are many C programs running on them. I haven't seen any statistics in this regard, but it's plausible that there are more C programs running on embedded systems than there are on general- purpose systems, or more freestanding C implementations than hosted implementations. Now, I have no idea how many of those freestanding implementations make use of address all-bits-zero, or are used on platforms where the use of address all-bits-zero is determined by the hardware design (so it might be useful to a C program). However, it is certain that quite a number of them do. Keith knows that's true for all platforms with a conforming C implemen- tation, because all such implementations must define such a value. In some cases the platform itself may provide a suitable location; in others, the implementation may have to pick a location and make sure that no C object is ever placed there. Dennis Ritchie reads Usenet, including sometimes c.l.c (he's been active in alt.folklore.computers lately); he reads and responds to email; and he maintains a list of known errors in K&R2, *as has already been noted in this thread*. Did you look at the errata list that someone posted a link to? [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
C Programming
Null pointers
Top