warning: ‘prog_char’ is deprecated static NOINLINE void SerialPrint_P(PGM_P str)

Hello,

I'm using the SD library that comes with the IDE (Arduino 1.0.5 + Ubuntu 14.04 LTS) and I'm getting these warnings:

In file included from /usr/share/arduino/libraries/SD/SD.h:20:0,
from AlphaPrototypeV1_1.ino:57:
/usr/share/arduino/libraries/SD/utility/SdFat.h:289:25: warning: ‘prog_char’ is deprecated [-Wdeprecated-declarations]
void write_P(PGM_P str);
^
/usr/share/arduino/libraries/SD/utility/SdFat.h:290:27: warning: ‘prog_char’ is deprecated [-Wdeprecated-declarations]
void writeln_P(PGM_P str);
^
In file included from /usr/share/arduino/libraries/SD/SD.h:21:0,
from AlphaPrototypeV1_1.ino:57:
/usr/share/arduino/libraries/SD/utility/SdFatUtil.h:58:45: warning: ‘prog_char’ is deprecated [-Wdeprecated-declarations]
static NOINLINE void SerialPrint_P(PGM_P str) {
^
/usr/share/arduino/libraries/SD/utility/SdFatUtil.h:67:47: warning: ‘prog_char’ is deprecated [-Wdeprecated-declarations]
static NOINLINE void SerialPrintln_P(PGM_P str) {

Although my code compiles normally, I'm still confused by these warnings. What is the meaning of this? Does it has something to do with this bug?

and

http://code.google.com/p/arduino/issues/detail?can=2&q=759&colspec=ID%20Type%20Status%20Priority%20Milestone%20Owner%20Summary&id=759

Is there any way to fix this warning? Perhaps a new SD library version?

From the 1.8.x AvrLibC docs.

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.

Thank you for the information, but I’m a complete newbie. How do I take care of this?

  1. Use the 1.0.6 or 1.5.8 IDE downloads from the Arduino site they seem to work with the SD library w/o warnings. Ubuntu has, it seems, bundled a toolchain and library that are not compatable.

  2. Warnings do not stop compilation perhaps the program will operate properly. Ignore the warnings and test it.

  3. Try GitHub - greiman/SdFat: Arduino FAT16/FAT32 exFAT Library. It may not be a straight drop-in. And he warns it is likely to break stuff.

Yes! thank you, tha latest version (1.0.6) does not show any warnings :).

It's a shame the Ubuntu repository doesn't have the latest one, as the current is 1.0.5

Maybe I spoke too soon...

I just came to realized that in order to get no warnings you must run it twice: the first time with the 1.0.5 and the second one with the 1.0.6. At least this seems to work for me.

The problem with the Arduino IDE's from Ubuntu is they seem to be compelled to add their own toolchain. That is the reason your 1.0.5 has problems with the SD Lib. I have never had problems with the SD Lib using the Arduino IDE's from Arduino.

When you switch between different versions of the IDE you may want to clear the old build folders from /tmp as they will be reused by the IDE.