avr-libc-dev
[Top][All Lists]
Advanced

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

Re: [avr-libc-dev] Progmem types compatibility


From: David Brown
Subject: Re: [avr-libc-dev] Progmem types compatibility
Date: Tue, 10 Jan 2012 08:37:33 +0100
User-agent: Mozilla/5.0 (Windows NT 5.1; rv:8.0) Gecko/20111105 Thunderbird/8.0

On 10/01/2012 08:13, Joerg Wunsch wrote:
As Dmitry wrote:

IMHO, there is no bases for such abort (in case of C source and known
GCC version, i.e.<= 4.6).  It is sufficient to put warning:
      prog_char s[] = "123";
      ==>  warning: 'prog_char' is deprecated
and continue building.

If you find a way to put such a warning without bothering *everyone*
(who includes<avr/pgmspace.h>) with the warning, I'm fine with that.
The problem with adding the "deprecated" attribute to the typedef was
that the warning fires as soon as someone includes the header file,
not just when they are about to use it.

I'm afraid GCC lacks a method to delay the warning until the typedef
is actually used.


Would it be possible to replace the typedef with a #define? I haven't looked at it in detail, so that's just a stab in the dark - but it might get the "delay until use" effect you want.

mvh.,

David





reply via email to

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