On 08/20/2012 10:10 PM, David Brown wrote:
Almost certainly, there is something wrong in your code, or in the way
you have declared your external data - the "-Wuninitialized" flag should
not give false positives as you describe.  (It can give false positives,
when you know yourself that all code paths that use the data have
initialised the variables but the compiler is unable to prove this.)

I got rid of most of the "-Wuninitialized" warnings by introducing intermediate typedefs - for instance, replacing

extern  const double    sunrise_fact[] PROGMEM;
   by
typedef double PROGMEM          prog_double;
extern  const prog_double       *sunrise_fact;


One single warning remains that I did not manage to suppress:

extern  const prog_int8_t max_module;

What is wrong with that? max_module is defined in another module and is initialised to a very constant value. The warning message is given when VersionPanel.c is compiled

VersionPanel.c: In function 'ShowCpuInfo':
VersionPanel.c:71:26: warning: uninitialized variable 'max_module' put into program memory area [-Wuninitialized]

and the reference to max_module in ShowCpuInfo is:

    if ( x_value <= pgm_read_byte ( &max_module ) ) {

Any suggestions how to avoid this last warning - would be great if I get back to a make listing without warnings.

_______________________________________________
AVR-GCC-list mailing list
AVR-GCC-list@nongnu.org
https://lists.nongnu.org/mailman/listinfo/avr-gcc-list

Reply via email to