Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   C Programming (http://www.velocityreviews.com/forums/f42-c-programming.html)
-   -   Re: LHS casting (http://www.velocityreviews.com/forums/t958310-re-lhs-casting.html)

Shao Miller 03-03-2013 02:44 PM

Re: LHS casting
 
On 3/3/2013 08:40, Russell Shaw wrote:
> Hi,
> gcc-4.7 -pedantic accepts:
>
> (*(volatile int *) 0x20) = 0;
>
>
> I fail to see how in N1570:
>
> [...]
>
> I can't see any extension in "info gcc".


(*(volatile int *) 0x20) = 0;
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^- statement, expression-statement

(*(volatile int *) 0x20) = 0;
^^^^^^^^^^^^^^^^^^^^^^^^^^^^- expression, assignment-expression

(*(volatile int *) 0x20) = 0;
^^^^^^^^^^^^^^^^^^^^^^^^ ^ ^- assignment-expression
| +- assignment-operator
+- unary-expression, postfix-expression, primary-expression

(*(volatile int *) 0x20) = 0;
( expression )

(*(volatile int *) 0x20) = 0;
^^^^^^^^^^^^^^^^^^^^^^- expression, assignment-expression,
conditional-expression, logical-OR-expression, logical-AND-expression,
inclusive-OR-expression, exclusive-OR-expression, AND-expression,
equality-expression, relational-expression, shift-expression,
additive-expression, multiplicative-expression, cast-expression,
unary-expression

(*(volatile int *) 0x20) = 0;
^- unary-operator

(*(volatile int *) 0x20) = 0;
^^^^^^^^^^^^^^^^^^^^^- cast-expression

(*(volatile int *) 0x20) = 0;
^^^^^^^^^^^^^^ ^^^^
+- type-name +- cast-expression, unary-expression,
postfix-expression, primary-expression, constant

What is the trouble?

--
- Shao Miller
--
"Thank you for the kind words; those are the kind of words I like to hear.

Cheerily," -- Richard Harter


All times are GMT. The time now is 01:38 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.