COIN-OR::LEMON - Graph Library

Opened 10 years ago

Closed 10 years ago

#158 closed enhancement (wontfix)

NULL vs. 0

Reported by: kpeter Owned by: kpeter
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)

null_445b86e6bb9f.patch (3.1 KB) - added by kpeter 10 years ago.

Download all attachments as: .zip

Change History (6)

Changed 10 years ago by kpeter

comment:1 in reply to: ↑ description ; follow-up: Changed 10 years ago by 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++.
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++.

comment:2 in reply to: ↑ 1 ; follow-up: Changed 10 years ago by kpeter

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 in reply to: ↑ 2 Changed 10 years ago by alpar

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 10 years ago by kpeter

So we should close this ticket with "won't fix" status, shouldn't we?

comment:5 Changed 10 years ago by alpar

  • Resolution set to wontfix
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.