Abdellazizhammami / arduino

Automatically exported from code.google.com/p/arduino
Other
0 stars 0 forks source link

Warnings with PROGMEM in extern declaration #762

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Arduino 1.0, file Arduino.h declares a number of variables like this

extern const uint8_t PROGMEM digital_pin_to_port_PGM[];

This produces warnings with -Wall from avr-gcc 4.6.2

/usr/local/pckg/arduino/arduino-1.0/hardware/arduino/cores/arduino/Arduino.h:130
:30: warning: uninitialized variable 'digital_pin_to_port_PGM' put into program 
memory area [-Wuninitialized]

Comparing the output of avr-objdump shows that the PROGMEM can be removed from 
the extern declaration without change to the compiled code.

What steps will reproduce the problem?
1. Compile your favourite sketch using some Arduino pins with avr-gcc 4.6.2.

What version of the Arduino software are you using? On what operating
system?

Vanilla avr-gcc 4.6.2, avr-libc 1.7.1, Linux, 328P.

Patch attached.

Original issue reported on code.google.com by gooc...@top.geek.nz on 25 Dec 2011 at 5:33

Attachments: