This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/53382] incorrect associativity in expressions
- From: "miguel.barao at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 17 May 2012 09:42:48 +0000
- Subject: [Bug c/53382] incorrect associativity in expressions
- Auto-submitted: auto-generated
- References: <bug-53382-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53382
--- Comment #4 from Miguel Barao <miguel.barao at gmail dot com> 2012-05-17 09:42:48 UTC ---
There was a misunderstanding between associativity and operator evaluation
order in the original bugreport.
I now understand that the language does not specify the evaluation order of an
operator, and is bad a practice to depend such behavior.
Still, I would like to add that expressions like
- f( ) + f( )
and
- ( f( ) - f( ) )
produce different evaluation orders, and therefor different results, when f( )
has side effects.