Topic: Will the latest draft standard end the NUL
Author: gjohnson@dream.season.com (Reality is a point of view)
Date: 1996/09/04 Raw View
+---- clamage@eng.sun.com wrote (29 Aug 1996 22:45:53 GMT):
| It would help if you said what needed improving. I've
| always thought the wording was pretty clear and straightforward.
Please see section 5 of the C FAQ.
| because '\0' qualifies as a null pointer constant.
+----
ptr = '\0' opens up that 'conversion in a pointer context' can
of worms and is usually good for a few days of thrashing.
--
Gary Johnson "Rosebud . . ."
gjohnson@season.com <a href="http://www.epic.org/privacy/wiretap">Freedom?</a>
CAMPAIGN '96: Juck 'em if they can't fake a toke.
---
[ comp.std.c++ is moderated. To submit articles: Try just posting with your
newsreader. If that fails, use mailto:std-c++@ncar.ucar.edu
comp.std.c++ FAQ: http://reality.sgi.com/austern/std-c++/faq.html
Moderation policy: http://reality.sgi.com/austern/std-c++/policy.html
Comments? mailto:std-c++-request@ncar.ucar.edu
]
Author: clamage@eng.sun.com (Steve Clamage)
Date: 1996/08/29 Raw View
In article gjohnson@dream.season.com, gjohnson@dream.season.com (Reality is a point of view) writes:
>Has the language surrounding the nature of NULL improved?
It would help if you said what needed improving. I've
always thought the wording was pretty clear and straightforward.
>I've switched to 0 and if( ptr ) forever, but that doesn't keep
>me from throwing things like ptr = '\0'; if there is a long,
>annoying public argument about NULL vs the universe.
I don't follow the last paragraph. You can use NULL if you want to
to indicate a null pointer constant. NULL is normally #defined to be 0
because most any other definition is likely to cause problems. You
can write
if( ptr == 0 )
or
if( ptr == NULL )
if you want. You can write
ptr = '\0'
because '\0' qualifies as a null pointer constant.
What changes do you want? If you object to the last example, maybe
you would like to further restrict the types of constant zero which
may be considered a null pointer constant. Anything else?
---
Steve Clamage, stephen.clamage@eng.sun.com
[ comp.std.c++ is moderated. To submit articles: try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ FAQ: http://reality.sgi.com/employees/austern_mti/std-c++/faq.html ]
[ Policy: http://reality.sgi.com/employees/austern_mti/std-c++/policy.html ]
[ Comments? mailto:std-c++-request@ncar.ucar.edu ]