public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Georg-Johann Lay <avr@gjlay.de>
To: "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>
Subject: [patch,avr,applied] Adjust message for SIGNAL and INTERRUPT usage
Date: Fri, 22 Mar 2024 17:34:09 +0100	[thread overview]
Message-ID: <219331fb-e297-442b-b2b8-68c853a762bc@gjlay.de> (raw)

Applied this patchlet for a more precise diagnostic.

Johann

--

AVR: Adjust message for SIGNAL and INTERRUPT usage

gcc/
	* config/avr/avr.cc (avr_set_current_function): Adjust diagnostic
	for deprecated SIGNAL and INTERRUPT usage without respective header.

diff --git a/gcc/config/avr/avr.cc b/gcc/config/avr/avr.cc
index 12c59668b4c..4a5a921107b 100644
--- a/gcc/config/avr/avr.cc
+++ b/gcc/config/avr/avr.cc
@@ -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.  */

                 reply	other threads:[~2024-03-22 16:34 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=219331fb-e297-442b-b2b8-68c853a762bc@gjlay.de \
    --to=avr@gjlay.de \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).