[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] generic queue library for AVR GCC?
From: |
Andy Warner |
Subject: |
Re: [avr-gcc-list] generic queue library for AVR GCC? |
Date: |
Wed, 17 Nov 2004 14:15:14 -0600 |
User-agent: |
Mutt/1.2.5i |
Dave Hansen wrote:
> [...]
> But the comma operator has lower precedence than the assignment operator.
> So
>
> sreg = SREG, cli();
>
> should parse as
>
> (sreg = SREG), (cli());
>
> Which is why I question the original code, which mixes in a declaration.
> The = in the declaration is not an assignment operator, so I suspect that
> will parse as
>
> unsigned char sreg = (SREG, cli());
>
> as you suggest.
Testing shows it works OK too. My mistake not to check
precedence of comma wrt assignment before typing. See
also Ted's empirical proof.
I don't think #defines like this are a good idea in
general, but that's my preference; and I'm happy to admit
being both wrong and trigger happy about Bruce's idea
not working as advertised..
I'll get back to lurking now.
--
address@hidden
Andy Warner Voice: (612) 801-8549 Fax: (208) 575-5634
- Re: [avr-gcc-list] generic queue library for AVR GCC?, (continued)
- Re: [avr-gcc-list] generic queue library for AVR GCC?, Theodore A. Roth, 2004/11/17
- Message not available
- Re: [avr-gcc-list] generic queue library for AVR GCC?, E. Weddington, 2004/11/15
- Re: [avr-gcc-list] generic queue library for AVR GCC?, rusty+avr-gcc-list, 2004/11/15
- Re: [avr-gcc-list] generic queue library for AVR GCC?, Theodore A. Roth, 2004/11/15
- Re: [avr-gcc-list] generic queue library for AVR GCC?, Bruce D. Lightner, 2004/11/15
- Re: [avr-gcc-list] generic queue library for AVR GCC?, Theodore A. Roth, 2004/11/15
- Re: [avr-gcc-list] generic queue library for AVR GCC?, Geoffrey Wossum, 2004/11/16
Re: [avr-gcc-list] generic queue library for AVR GCC?, Dave Hansen, 2004/11/17
- Re: [avr-gcc-list] generic queue library for AVR GCC?,
Andy Warner <=