Re: Paying developers to get features faster
From: Baho Utot (baho-utot_at_philippines-island.org)
Date: 01/25/04
- Next message: Christopher Browne: "Re: Linux has a long way to go before it becomes the major OS"
- Previous message: Baho Utot: "Re: Paying developers to get features faster"
- In reply to: Måns Rullgård: "Re: Paying developers to get features faster"
- Next in thread: John Winters: "Re: Paying developers to get features faster"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Sun, 25 Jan 2004 00:01:03 GMT
Måns Rullgård wrote:
> Brad Olin <bwo@bwo1.com> writes:
>> The one time that I have actually seen when the traditional "if (<var>)"
>> test was an invalid test was a case of a pointer that should have been
>> compared to NULL. i.e "if (<var> != NULL)" vrs "if (<var>)". I tracked
>> this case down into a third party library that re-defined NULL to a
>> non-zero value. I'm not a complete ANSI C guru, but I think that NULL
>> is a notion of invalid and not guaranteed to be zero.
>
> Yes, it's something like that. However, the standard does specify
> that a NULL pointer value used as a truth value must be false. Thus,
> your particular setup was not ANSI C compliant.
>
But if you compare to an unadorned 0 it is garranteed to work. I believe
using NULL for a pointer comparison is nothing more than a crutch.
- Next message: Christopher Browne: "Re: Linux has a long way to go before it becomes the major OS"
- Previous message: Baho Utot: "Re: Paying developers to get features faster"
- In reply to: Måns Rullgård: "Re: Paying developers to get features faster"
- Next in thread: John Winters: "Re: Paying developers to get features faster"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|