]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
AVR: Adjust message for SIGNAL and INTERRUPT usage
authorGeorg-Johann Lay <avr@gjlay.de>
Fri, 22 Mar 2024 16:29:21 +0000 (17:29 +0100)
committerGeorg-Johann Lay <avr@gjlay.de>
Fri, 22 Mar 2024 18:30:18 +0000 (19:30 +0100)
gcc/
* config/avr/avr.cc (avr_set_current_function): Adjust diagnostic
for deprecated SIGNAL and INTERRUPT usage without respective header.

gcc/config/avr/avr.cc

index 12c59668b4c8f24a85c4ab003e2373491b8dad92..4a5a921107bb27463b065587a8a23a89700108a8 100644 (file)
@@ -1495,14 +1495,20 @@ avr_set_current_function (tree decl)
   // Common problem is using "ISR" without first including avr/interrupt.h.
   const char *name = IDENTIFIER_POINTER (DECL_NAME (decl));
   name = default_strip_name_encoding (name);
-  if (strcmp ("ISR", name) == 0
-      || strcmp ("INTERRUPT", name) == 0
-      || strcmp ("SIGNAL", name) == 0)
+  if (strcmp ("ISR", name) == 0)
     {
       warning_at (loc, OPT_Wmisspelled_isr, "%qs is a reserved identifier"
                  " in AVR-LibC.  Consider %<#include <avr/interrupt.h>%>"
                  " before using the %qs macro", name, name);
     }
+  if (strcmp ("INTERRUPT", name) == 0
+      || strcmp ("SIGNAL", name) == 0)
+    {
+      warning_at (loc, OPT_Wmisspelled_isr, "%qs is a deprecated identifier"
+                 " in AVR-LibC.  Consider %<#include <avr/interrupt.h>%>"
+                 " or %<#include <compat/deprecated.h>%>"
+                 " before using the %qs macro", name, name);
+    }
 #endif // AVR-LibC naming conventions
 
   /* Don't print the above diagnostics more than once.  */