[Top][All Lists]

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

Re: [avr-gcc-list] Compiler warning

From: E. Weddington
Subject: Re: [avr-gcc-list] Compiler warning
Date: Tue, 26 Nov 2002 10:49:12 -0700

On 26 Nov 2002 at 8:27, David Breeze wrote:

> Hi Eric
> Thank you for the response. 
> The read (in) is for any one of the I/O registers in the ATmega
> 323/ATmega32.  This particular problem appears to be specific in that
> a similar inline function utilising the lpm instruction behaves as I
> would expect and does not produce a warning.
> I am aware that the compiler is not the latest, however, this
> particular project is too far down the road to change compilers
> without very good reason.  (There are significant differences between
> the compiler I am using and the latest incarnation).  Also the latest
> compilers are all marked "experimental" and our QA team would have a
> field day with that!
> The macros referred to are those with the libc distibution i.e.
> inp(...) etc.  Incidentally it is the use of the C extensions (use of
> braces within an expression etc) that causes me a problem.  It is very
> likely that we will be restricted to the core set of C in the future,
> a similar standard to the MISRA spec.
> Regards
> David Breeze

That's a shame you have your hands tied. With the newer AVRLibC, 
those macros are deprecated and direct access is the norm. So you 
could write:

result = PINA;


PORTA |= 0x80;

or somesuch like that. The compiler itself handles the code; with no 
macros. Perhaps this change alone will help to convince the (software 
police | QC) people. :-)

The downside is that the latest AVRLibC needs to be compiled with GCC 
3.3 which is in the latter parts of Stage 3 before release. (See:
http://www.gnu.org/software/gcc/develop.html#future). GCC says they 
are tentatively releasing 3.3 in mid-December. However, in the recent 
announcement of 3.2.1, it was said that there will probably be a 
release of 3.2.2 and /then/ 3.3. My guess is that 3.3 will be 
released sometime in December or January. When 3.3 is released, 
AVRLibC is planning to release a stable library (a 1.0) soon after 
that. At that point, there will be a stable toolset: Binutils, GCC, 

GCC 3.3 is pretty stable now... but it's not official yet. And I 
don't know if your project can wait a couple of months. But the 
toolset sure has advanced far since 3.0.2!

As to your specific problem,

Look in the GCC documentation:

Under the heading, 
Assembler Instructions with C Expression Operands

Perhaps you'll find more information on how to get your code working. 
Look for the Atmel AVR specific constraints. (Look under
Constraints for Particular Machines). There oughtta be a way to get 
it working.

avr-gcc-list at http://avr1.org

reply via email to

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