COIN-OR::LEMON - Graph Library

Opened 15 years ago

Closed 15 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)

null_445b86e6bb9f.patch (3.1 KB) - added by Peter Kovacs 15 years ago.

Download all attachments as: .zip

Change History (6)

Changed 15 years ago by Peter Kovacs

Attachment: null_445b86e6bb9f.patch added

comment:1 in reply to:  description ; Changed 15 years ago by Alpar Juttner

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 ; Changed 15 years ago by Peter Kovacs

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 15 years ago by Alpar Juttner

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 15 years ago by Peter Kovacs

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

comment:5 Changed 15 years ago by Alpar Juttner

Resolution: wontfix
Status: newclosed
Note: See TracTickets for help on using tickets.