avr-libc-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-libc-dev] Re: Request for cbrt() and strdup to be added tolibc


From: Joerg Wunsch
Subject: Re: [avr-libc-dev] Re: Request for cbrt() and strdup to be added tolibc
Date: Sun, 22 Jun 2008 22:35:26 +0200
User-agent: Mutt/1.5.11

As Weddington, Eric wrote:

> Good catch. Regardless whether it generates the same code or not, it
> should be compared to NULL anyway because one should never rely on
> NULL being zero.

In C, the only possible definitions for NULL are "0" or "((void *)0)".
In C++, IIRC only "0" is possible.

> Since copy is a pointer, it should be compared to NULL, and
> not with a logical NOT operator.

That's my point.  It's not a Boolean operation but a comparison
against a null pointer.  The test against NULL just makes that
more obvious.

-- 
cheers, J"org               .-.-.   --... ...--   -.. .  DL8DTL

http://www.sax.de/~joerg/                        NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]