In ANSI C, NULL is a macro that the C preprocessor converts into
a null pointer constant. A null pointer constant is an integer
constant expression with the value 0 or the cast of such an expression
to void*.
However, it is NOT a null pointer. It is compiled into a null pointer.
And the bit representation of a null pointer need NOT be zeros. Null
pointers are implementation-dependent and may be different for different
types, for example, pointers to data objects vs. pointers to functions.
All that's required is that any two null pointers are ==, that casting
a null pointer of one type to another pointer type results in a null
pointer, and that null pointers can't be confused for an actual pointer
to some object or function.
-- Brad
-----Original Message-----
From: owner-sv-ec@eda.org [mailto:owner-sv-ec@eda.org]On Behalf Of Neil
Korpusik
Sent: Tuesday, November 23, 2004 1:37 PM
To: sv-ec@eda.org
Subject: Re: [sv-cc] RE: [sv-ec] Clarification on my earlier mail
regarding on strings
More email from the same series of emails.
Neil
-------- Original Message --------
Subject: BOUNCE sv-ec@eda.org: Non-member submission from ["Steven J.
Dovich" <dovich@cadence.com>]
Date: Tue, 23 Nov 2004 08:29:38 -0800 (PST)
From: owner-sv-ec@eda.org
To: sv-ec-approval@eda.org
Yes, though as I noted, NUL as a character name is not acknowledged
in the C standard. It is a (somewhat) common usage from the ASCII
standard and is replaced in the C standard with "null character".
When spelled in lower case, the word "null" is ambiguous and must
be qualified by "character", "pointer", etc. The upper case NULL
is the standardized spelling for a "null pointer", a constant
expression evaluating to zero that is used as a pointer.
/sjd
> So NULL is a pointer and NUL is a character?
>
> Thanks,
> Shalom
>
>
> On Tue, 23 Nov 2004, Steven J. Dovich wrote:
>
> > My apologies to Doug and Rob for using their comments as a soapbox
> > for a pre-existing problem in the Verilog standard. Fortunately 1800
> > does not appear to have imported the problem, but we need to be
> > vigilant that it does not spread. Now for the standards rant...
> >
> > To be properly consistent with the C language, we also need to
> > recognize that NULL is not a character, it is a pointer. C strings
> > are composed of characters and are terminated by a "null character".
> > Common usage also designates the character valued as '\0' as the
> > NUL character from the ASCII character names (note the three letter
> > spelling).
> >
> > Our draft would be improved by not requiring the reader to understand
> > that we didn't exactly mean what we really said.
> >
> > /sjd
>
> --
> Shalom Bresticker Shalom.Bresticker @freescale.com
> Design & Verification Methodology Tel: +972 9 9522268
> Freescale Semiconductor Israel, Ltd. Fax: +972 9 9522890
> POB 2208, Herzlia 46120, ISRAEL Cell: +972 50 5441478
>
> [ ]Freescale Internal Use Only [ ]Freescale Confidential Proprietary
-- --------------------------------------------------------------------- Neil Korpusik Tel: 408-720-4852 Member of Technical Staff Fax: 408-720-4850 Frontend Technologies - ASICs & Processors (FTAP) Sun Microsystems email: neil.korpusik@sun.com ---------------------------------------------------------------------Received on Tue Nov 23 18:06:35 2004
This archive was generated by hypermail 2.1.8 : Tue Nov 23 2004 - 18:06:42 PST