[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] [ANN] WinAVR 20030115
From: |
Lucio De Re |
Subject: |
Re: [avr-gcc-list] [ANN] WinAVR 20030115 |
Date: |
Wed, 5 Feb 2003 10:21:37 +0200 |
On Wed, Feb 05, 2003 at 08:36:54AM +0100, Volkmar Dierkes wrote:
>
> change
> #define set_sleep_mode(mode) (MCUCR = ((MCUCR & ~SLEEP_MODE_MASK) | (mode))
> to
> #define set_sleep_mode(mode) MCUCR = ((MCUCR & ~SLEEP_MODE_MASK) | (mode))
>
> There is a '(' to much.
>
Too few:
#define set_sleep_mode(mode) (MCUCR = ((MCUCR & ~SLEEP_MODE_MASK) | (mode)))
If this is used in an expression, the assignment operator's priority
can cause confusion:
z = x << set_sleep_mode(y);
(hm, I'm not as comfortable with operator priority as I ought to be,
all the more reason for the extra sets of parentheses).
++L