avr-gcc-list
[Top][All Lists]
Advanced

[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: Russell Shaw
Subject: Re: [avr-gcc-list] Re: WinAVR 20050214 (gcc 3.4.3) and optimizer bug.
Date: Tue, 10 May 2005 01:47:21 +1000
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.5) Gecko/20050105 Debian/1.7.5-1

Larry Barello wrote:
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".

If a pointer is NULL, the actual behind-the-scenes address it represents may
be anything, and is just something a compiler assigns to a pointer object that
is in a known state of "unsettedness".

I don't know what gcc uses for the avr.

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?

As in: if(foo == NULL) or: if(foo == 0) or: if(foo)  ?

Definitely not.

Do I need to add this to my makefile scripts?  Is this a
lurking problem prior to the latest WinAVR release?

No.
Where the compiler doesn't know whether a value is going to be used as a
pointer, is a cast required. Ie: execl("/bin/sh", "sh", "-c", "date", (char 
*)0);
this function is variadic, so the type of the parameters is unknown from the
prototype.




reply via email to

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