[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug-gnulib] Re: null vs. `NUL byte'
From: |
Paul Eggert |
Subject: |
[bug-gnulib] Re: null vs. `NUL byte' |
Date: |
Sat, 26 Mar 2005 20:49:48 -0800 |
User-agent: |
Gnus/5.1006 (Gnus v5.10.6) Emacs/21.4 (gnu/linux) |
Jim Meyering <address@hidden> writes:
> isn't `NUL byte' unambiguous?
Yes, but it's nonstandard. POSIX defines
NUL: A character with all bits set to zero.
null byte: A byte with all bits set to zero.
and it would be better not to mix the two notions, for the sake of
environments where byte != character. (Admittedly coreutils doesn't
always do this now....)
I don't see the need to sweep through code and comments looking for
all instances of the phrase "null-terminated" and replacing it with
"null-byte-terminated" or whatever. It's normally clear from the
context whether the phrase is talking about null bytes, null pointers
or whatever.
> what about uses of NUL-terminate?
That would be standard in contexts where we are talking about
sequences of characters (not bytes or pointers or etc.). My guess is
that this is relatively rare.
>> I suspect the existing comments sometimes say "null character" when
>> they should say "null byte".
>
> Or maybe just "'\0'"?
> or `zero byte'.
"zero byte" might confuse people into thinking it's '0'. I suppose
you could talk me into "'\0'" but it's not a huge win over "null byte".
Not really a big deal either way I suppose.