[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] Byte values promted to int when during compare
From: |
Geoffrey Wossum |
Subject: |
Re: [avr-gcc-list] Byte values promted to int when during compare |
Date: |
Thu, 24 Jun 2004 09:01:54 -0500 |
User-agent: |
KMail/1.6.2 |
On Thursday 24 June 2004 7:59 am, Ned Konz wrote:
> Of course, GCC is notable for its extensions to the C language as well (see
> http://gcc.gnu.org/onlinedocs/gcc/C-Extensions.html). From the point of
> view of an AVR (and maybe also MSP430 and HC12) microcontroller user, I'd
> rather see some of the above extensions than some of the ones that are
> already in GCC.
You know what would be a really great extension to avr-gcc. Well, not really
an extension, but a new warning. If you have a function declared with the
signal attribute, warn about any global variables it accesses that aren't
declared volatile. I was trying to think of a situation where I might access
a global variable from an ISR but not want that variable to be volatile. I
haven't been able to think of any.
I don't know how hard it would be to add such support, or convince the gcc
maintainers to accept it. But it seems like an awful lot of people come onto
this list convinced they've found a bug in gcc, when it just turns out they
need a volatile declaration. I'm sure other people working with ISR's on
other platforms get caught by this trap when they're starting, too.
---
Geoffrey Wossum
Software Engineer
Long Range Systems - http://www.pager.net