This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Volatile MEMs in statement expressions and functions inlinedastrees



On Tue, 18 Dec 2001, Paul Schlie wrote:
>
> To be more clear, it would appear that:
>
> statement <- assignment-expression <- ? <- variable <- "p"
>
> Don't see how to get there from "p".

No.

The C language doesn't even _have_ a "assignment statement".

Assignments are just expressions. And expressions are built up from
sub-expressions.

It's perfectly valid C to write

	1+1;

as a statement. It's a statement expression, with the value 2. Obviously
that value is not actually _used_ for anything, so very few people write
programs like that, which is why it looks strange (and most compilers will
warn about "statement with no effect").

		Linus


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]