[Top][All Lists]

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

RE: [avr-gcc-list] Re: WinAVR 20050214 (gcc 3.4.3) and optimizer bug.

From: Larry Barello
Subject: RE: [avr-gcc-list] Re: WinAVR 20050214 (gcc 3.4.3) and optimizer bug.
Date: Mon, 9 May 2005 08:21:12 -0700

So, this is all facinating reading, but what, if anything, is a NULL pointer
in the AVR context?  Address 0 is certainly valid.  Or is it simply
convention that 0 is "null".

I didn't understand everything that was said, but it seemed clear to me that
having the construct

char *foo;

if (foo && (*foo !=0))

randomly break seemed pretty harsh.  Was (is) the solution to disable null
pointer checks?  Do I need to add this to my makefile scripts?  Is this a
lurking problem prior to the latest WinAVR release?

-----Original Message-----

Russell Shaw wrote:

> Only in cases where the context may not indicate where a pointer value is
> required:
>   http://www.eskimo.com/~scs/C-faq/q5.2.html
>   http://www.eskimo.com/~scs/C-faq/q5.3.html
>   http://www.eskimo.com/~scs/C-faq/s5.html

Thanks for the links, Russell. The first sentence in the first link:
"According to the language definition, a constant 0 in a pointer context
is converted into a null pointer at compile time."

I wasn't aware of this. Thanks for pointing it out. :-)


reply via email to

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