Re: sizeof(array) with variable-length array parametery

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

 



On Thu, Apr 10, 2008 at 09:42:44AM +0100, Andrew Haley wrote:
> > Maybe it's a good canditate for a GCC extension?
> 
> I'm not sure how.  C99 says "6.7.5.3 Function
> declarators (including prototypes) ...  A declaration of a
> parameter as ??????array of type?????? shall be adjusted to ??????qualified
> pointer to type??????, where the type qualifiers (if any) are those
> specified within the [ and ] of the array type derivation."


Even worse: in a footnote 84 to 6.5.3.4 it says: the sizeof yields the
size of the pointer type:-(

Haven't tried, but maybe __builtin_object_size is what I need?

> 
> Andrew.
> 

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux