===================================================================
@@ -5099,12 +5099,7 @@ avr_handle_progmem_attribute (tree *node
}
else if (TREE_STATIC (*node) || DECL_EXTERNAL (*node))
{
- if (DECL_INITIAL (*node) == NULL_TREE && !DECL_EXTERNAL (*node))
- {
- warning (0, "only initialized variables can be placed into "
- "program memory area");
- *no_add_attrs = true;
- }
+ *no_add_attrs = false;
}
else
{
@@ -5293,6 +5288,15 @@ avr_asm_init_sections (void)
void
avr_asm_named_section (const char *name, unsigned int flags, tree decl)
{
+ if (decl && DECL_P (decl)
+ && NULL_TREE == DECL_INITIAL (decl)
+ && avr_progmem_p (decl, DECL_ATTRIBUTES (decl)))
+ {
+ warning (OPT_Wuninitialized,
+ "uninitialized variable %q+D put into "
+ "program memory area", decl);
+ }
+
if (!avr_need_copy_data_p)
avr_need_copy_data_p = (0 == strncmp (name, ".data", 5)
|| 0 == strncmp (name, ".rodata", 7)