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

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

[avr-gcc-list] How to use pgmspace.h in a library source without warning


From: Georg-Johann Lay
Subject: [avr-gcc-list] How to use pgmspace.h in a library source without warning?
Date: Fri, 07 Jun 2013 18:53:52 +0200
User-agent: Thunderbird 2.0.0.24 (Windows/20100228)

Suppose the following include in a library source.c:

#include <avr/pgmspace.h>

and the source compiled with, e.g. -mmcu=avr5 or -mmcu=avr35 etc.

This throws a warning like:

$ avr-gcc -mmcu=avr5 source.c -c

In file included from INSTALL/avr/include/avr/pgmspace.h:88:0,
                 from source.c:1:
INSTALL/avr/include/avr/io.h:428:6: warning: #warning "device type not defined" [-Wcpp]

Is there a way to build library modules that use pgmspace functionality without such annoying warning?

The -mmcu= options are queried directly from the compiler, for example with avr-gcc 4.7:

$ avr-gcc -print-multi-lib
.;
avr25;@mmcu=avr25
avr3;@mmcu=avr3
avr31;@mmcu=avr31
avr35;@mmcu=avr35
avr4;@mmcu=avr4
avr5;@mmcu=avr5
avr51;@mmcu=avr51
avr6;@mmcu=avr6
avrxmega2;@mmcu=avrxmega2
avrxmega4;@mmcu=avrxmega4
avrxmega5;@mmcu=avrxmega5
avrxmega6;@mmcu=avrxmega6
avrxmega7;@mmcu=avrxmega7
tiny-stack;@msp8
avr25/tiny-stack;@address@hidden

The options are given by the parts after the ;

Thanks for advice


Johann



reply via email to

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