Bug 2752 - NULL is used instead of 0 many places
Summary: NULL is used instead of 0 many places
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: Unspecified
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 1997-02-17 09:20 UTC by Arne Henrik Juul
Modified: 1997-09-18 15:10 UTC (History)
0 users

See Also:


Attachments
file.diff (27.82 KB, patch)
1997-02-17 09:20 UTC, Arne Henrik Juul
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Arne Henrik Juul 1997-02-17 09:20:02 UTC
	Many places in the code NULL is used in integer context, where
	plain 0 should be used.  This happens to work because we #define
	NULL to 0, but is stylistically wrong and can cause problems
	for people trying to port bits of code to other environments.

Fix: Appy following patch.  This changes NULL to 0 most places
	but to '\0' in character context, to be more stylistically
	correct.
How-To-Repeat: 
	#define NULL ((void *)0) in various include files and recompile
	the world.
Comment 1 plm 1997-02-17 19:24:09 UTC
>> On Mon, 17 Feb 1997 10:10:59 +0100 (CET), Arne Henrik Juul
>> <arnej@imf.unit.no> said:

    AHJ> 	Appy following patch.  This changes NULL to 0 most places
    AHJ> 	but to '\0' in character context, to be more stylistically
    AHJ> 	correct.

Why is using '\0' more stylistically correct? A pointer is a pointer,
and one can always assign 0 to it.

One does not assign 0L to an long* either, but simply 0.
Comment 2 Poul-Henning Kamp freebsd_committer freebsd_triage 1997-09-18 15:09:53 UTC
State Changed
From-To: open->closed


committed, thanks!