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

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

Re: [avr-gcc-list] zero length array in nocommon


From: Dave Hylands
Subject: Re: [avr-gcc-list] zero length array in nocommon
Date: Wed, 23 Sep 2009 14:20:01 -0700

> This 'quirk' of gcc does not seem to be specifically avr related
> but probably we are the only one's left to care about the
> spoilled byte.

I seem to recall something (not sure if it's a language requirement or
not) about stuff needing to allocate at least one byte. This ensures
that when you take the address of one object it doesn't equal the
address of another object (which could happen if the object in fact
takes up zero bytes).

I also seem to recall that in C++ the new operator needs to allocate 1
byte, even when passed a length of zero to allocate.

-- 
Dave Hylands
Shuswap, BC, Canada
http://www.DaveHylands.com/




reply via email to

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