This is the mail archive of the binutils@sourceware.org mailing list for the binutils 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: Software Quality Binutils



> On Aug 14, 2018, at 7:12 AM, John Darrington <john@darrington.wattle.id.au> wrote:
> 
> ...
> I think it's flagging things like:
> 
> if (cond)
> {
>  do_this ();
>  do_that ();
> }
> else
> {
>  do_this ();
> }
> 
> ... which it wants changed to:
> 
> do_this ();
> if (cond)
> do_that ();
> 
> 
> which of-course has the same effect iff evaluating cond does not
> have side effects.

Not so; if do_this() may change cond, then the two are semantically different.

	paul


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