Gentoo Archives: gentoo-dev

From: Richard Freeman <rich0@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] FYI: Rules for distro-friendly packages
Date: Sun, 27 Jun 2010 11:28:47
Message-Id: 4C2735E2.4050008@gentoo.org
In Reply to: Re: [gentoo-dev] FYI: Rules for distro-friendly packages by Enrico Weigelt
On 06/27/2010 06:52 AM, Enrico Weigelt wrote:
>> remark #981: operands are evaluated in unspecified order (tons of them) >> return strcmp( left.c_str(), right.c_str() )> 0; > > I'm not sure if this really qualifies an warning, since - AFAIK - > C spec never said, that there is an evaluation order for > function parameters. >
I could see how somebody might make that assumption (incorrectly), and get burned by this. However, creating local variables just to hold intermediate results so as to not embed them in function calls seems to be a lot of overhead - certainly in terms of readability, and I can't think of a situation where the compiler would have to do it on its own. I guess religiously doing this might make the code less likely to contain very subtle bugs, but perhaps it is a bit over the top for anybody who wouldn't be otherwise developing in ADA. Rich