[ntp:questions] Unresolved Symbol

Per Hedeland per at hedeland.org
Wed Aug 22 19:19:26 UTC 2007


In article <ywn9k5roqp9q.fsf at ntp1.isc.org> Harlan Stenn <stenn at ntp.org>
writes:
>>>> In article <fafnqq$2db2$1 at hedeland.org>, per at hedeland.org (Per
>Hedeland) writes:
>
>>> if ((pOpts->pzCurOpt != NULL) && (*pOpts->pzCurOpt != NUL))
>
>Per> However I do think the use of NUL is unwise, having a plain '\0' there
>Per> instead would avoid an initial potentially confusing
>Per> misreading/misunderstanding (not incidentally, it is only the libopt
>Per> code that uses NUL, the "proper" ntp code uses '\0' everywhere).
>
>I think this is a personal preference thing.

Certainly if you don't expect others to (need to) read your code.

>I wrote tons of code using NUL for '\0' (the former is MUCH easier for me to
>type as I have carpal tunnel problems) and I also used NIL instead of
>NULL, as I find that much easier to read.

That's fine for you - but if others will need to read and understand
your code, it's a pretty objective fact that it helps if you stick to
the standard idioms of the language in question. For C, that includes
neither NUL nor NIL (the presence of a #define for NULL is even part of
the language standard requirements IIRC - though of course there is no
requirement to use it).

--Per Hedeland
per at hedeland.org




More information about the questions mailing list