Skip to content

deprecated typedef avr-libc v1.8.0 [imported] #795

Closed
@cmaglie

Description

@cmaglie

This is Issue 795 moved from a Google Code project.
Added by 2012-01-17T16:26:38.000Z by [email protected].
Please review that bug for more context and additional comments, but update this bug.
Closed (Fixed).

Original labels: Type-Defect, Priority-Medium, Component-Core, Milestone-1.0.1

Original description

There is a deprecated typedef in avr-gcc v1.8.0 that is apparently causing problems with Arduino IDE V1.0. Here is the error it generates:

/home/thomas/arduino/arduino-1.0/hardware/arduino/cores/arduino/Print.cpp: In member function 'size_t Print::print(const __FlashStringHelper*)':
/home/thomas/arduino/arduino-1.0/hardware/arduino/cores/arduino/Print.cpp:44:9: error: 'prog_char' does not name a type
/home/thomas/arduino/arduino-1.0/hardware/arduino/cores/arduino/Print.cpp:47:23: error: 'p' was not declared in this scope

I believe it is due to this deprecated typedef in pgmspace.h in avr-libc v1.8.0. Here is the entry from pgmspace.h:

/**
\ingroup avr_pgmspace
\typedef prog_char
\note DEPRECATED

This typedef is now deprecated because the usage of the progmem
attribute on a type is not supported in GCC. However, the use of the
progmem attribute on a variable declaration is supported, and this is
now the recommended usage.

The typedef is only visible if the macro PROG_TYPES_COMPAT
has been defined before including <avr/pgmspace.h> (either by a
#define directive, or by a -D compiler option.)

Type of a "char" object located in flash ROM.
*/
typedef char PROGMEM prog_char;

The data type prog_char is no longer valid without the macro. It appears the solution would be to replace the data type "prog_char" with "char PROGMEM" in
Print:print(const _FlashStringHelper*)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions