Opened 16 years ago
Closed 16 years ago
#158 closed enhancement (wontfix)
NULL vs. 0
Reported by: | Peter Kovacs | Owned by: | Peter Kovacs |
---|---|---|---|
Priority: | minor | Milestone: | LEMON 1.0 release |
Component: | core | Version: | hg main |
Keywords: | Cc: | ||
Revision id: |
Description
As far as know the sugested way to define null pointers is using 0 instead of NULL
.
In the source codes there are only a few usage of NULL
, [445b86e6bb9f] replaces them with 0.
Attachments (1)
Change History (6)
Changed 16 years ago by
Attachment: | null_445b86e6bb9f.patch added |
---|
comment:1 follow-up: 2 Changed 16 years ago by
comment:2 follow-up: 3 Changed 16 years ago by
Replying to alpar:
Replying to kpeter:
As far as know the sugested way to define null pointers is using 0 instead of
NULL
.IMHO this is a very strange "guideline" in C++.
Okay, what should we do then? Do we want to have a convention about this question or both form will be accepted? (E.g. in bfs/dfs/dijkstra in most cases 0 is used, but in only one constructor NULL
is used.)
comment:3 Changed 16 years ago by
Replying to kpeter:
Okay, what should we do then? Do we want to have a convention about this question or both form will be accepted? (E.g. in bfs/dfs/dijkstra in most cases 0 is used, but in only one constructor
NULL
is used.)
We all know that NULL
and 0 is equivalent in this context. Does it give us any benefit to introduce a another convention and force people to follow it? I don't think so.
comment:4 Changed 16 years ago by
So we should close this ticket with "won't fix" status, shouldn't we?
comment:5 Changed 16 years ago by
Resolution: | → wontfix |
---|---|
Status: | new → closed |
Replying to kpeter:
IMHO this is a very strange "guideline" in C++. The implicit int -> pointer conversion always "smells" like hacking to me, thus I personally prefer using
NULL
.Actually
NULL
will never be really deprecated, as keeping the backward compatibility with C is a fundamental design rule of C++.