avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] Code Optimisation question re: volatile


From: E. Weddington
Subject: Re: [avr-gcc-list] Code Optimisation question re: volatile
Date: Fri, 23 Jul 2004 09:24:25 -0600

On 23 Jul 2004 at 17:15, David Brown wrote:

> > On 23 Jul 2004 at 8:36, David Brown wrote:
> >
> > OT:
> >
> I don't actually give much weight to coding standards that I've seen - they
> frequently either don't go far enough, or ban a lot of constructs that are
> mostly a bad idea, but occasionally very useful.  For example,
> assign-to-assignment-result can be a neat way to write things like "if (key =
> readKey()) ... ", but writing "x = *y++ = z" is never a good idea!
> 
Agreed! :-)

Usually with an assignment in an if statement I also try to avoid an *implied* 
condition and make it *explicit*, to avoid confusion such as:

if ((key = readKey()) != 0)

Eric


reply via email to

[Prev in Thread] Current Thread [Next in Thread]