tinycc-devel
[Top][All Lists]
Advanced

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

Re: [Tinycc-devel] Strange sizeof construct


From: Chris Lattner
Subject: Re: [Tinycc-devel] Strange sizeof construct
Date: Wed, 14 Nov 2007 17:31:54 -0800


On Nov 14, 2007, at 5:18 PM, Mike wrote:

>>> printf("%d\n",sizeof(arr)[0]); // ok, but why?
Why should that be valid syntax?  Is C99 really weird or what?
(its a immediate value being used in place of a pointer.)

The C99 grammar says that sizeof is:

unary-expression:
  sizeof unary-expression

Why do you think it is invalid? You don't think that "(arr)[0]" is a valid expression?

-Chris




reply via email to

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