[Top][All Lists]

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

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

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

Thomas D. Dean schrieb:
On 06/07/13 09:53, Georg-Johann Lay wrote:
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?

Look at avr/io.h, where the warning is issued. avr5 is not one of the defined device types.

You have to use a specific device.

Tom Dean

That's not a good approach.  Reading avr/io.h, the solution reads


Libraries are typically defined for groups of devices, not for each of the ~ 200 AVR devices...


reply via email to

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