[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-libc-dev] [bug #33716] pgmspace typedefs not legal
From: |
Weddington, Eric |
Subject: |
Re: [avr-libc-dev] [bug #33716] pgmspace typedefs not legal |
Date: |
Sat, 9 Jul 2011 15:01:58 -0600 |
> -----Original Message-----
> From: address@hidden
> [mailto:address@hidden On
> Behalf Of Georg-Johann Lay
> Sent: Saturday, July 09, 2011 4:26 AM
> To: Georg-Johann Lay; Bill Westfield; address@hidden
> Subject: [avr-libc-dev] [bug #33716] pgmspace typedefs not legal
>
> Follow-up Comment #1, bug #33716 (project avr-libc):
>
> As Bill already wrote, attribute progmem just works by accident in avr-gcc
> (
> and not at all in avr-g++).
>
> It appears that
> const prog_char c = 'a';
> works for C and not for C++. However, there is *no* support for progmem
> in
> types it in avr-gcc and there is no guarantee that it will work for any
> code
> imagineable.
>
> I highly recommend to deprecate types like prog_char:
>
> typedef char __attribute__((progmem,deprecated)) prog_char;
>
> or
>
> typedef char __attribute__((progmem,deprecated("message"))) prog_char;
>
> Notice that despite "progmem", "deprecated" *is* documented for types.
>
> As the next release of avr-libc will come with bulk of poison, anyway,
> this
> bit of deprecation won't hurt and will help users to write more robust
> code.
Agreed, Johann. This should be done before the next release of avr-libc which
will be 1.8.0.
Eric