public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] c-family: Use -Wdiscarded-qualifiers for ignored qualifiers in __atomic_*
@ 2023-12-17 15:38 Florian Weimer
  2023-12-18  0:02 ` Jonathan Wakely
  2023-12-18 18:22 ` Joseph Myers
  0 siblings, 2 replies; 3+ messages in thread
From: Florian Weimer @ 2023-12-17 15:38 UTC (permalink / raw)
  To: gcc-patches; +Cc: Jonathan Wakely

This matches other compiler diagnostics.  No test updates are needed
because c-c++-common/pr95378.c does not match a specific -W option.

Fixes commit d2384b7b24f8557b66f6958a05ea99ff4307e75c ("c-family:
check qualifiers of arguments to __atomic built-ins (PR 95378)").

gcc/c-family/

	PR c/113050
	* c-common.cc (get_atomic_generic_size): Use
	OPT_Wdiscarded_qualifiers instead of
	OPT_Wincompatible_pointer_types.

---

Jonathan, I assume this was just an oversight in your patch, and there
is no fundamental reason to use -Wincompatible-pointer-types here?

Thanks,
Florian

 gcc/c-family/c-common.cc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gcc/c-family/c-common.cc b/gcc/c-family/c-common.cc
index 0f1de44a348..6ea727f446f 100644
--- a/gcc/c-family/c-common.cc
+++ b/gcc/c-family/c-common.cc
@@ -7637,7 +7637,7 @@ get_atomic_generic_size (location_t loc, tree function,
 		return 0;
 	      }
 	    else
-	      pedwarn (loc, OPT_Wincompatible_pointer_types, "argument %d "
+	      pedwarn (loc, OPT_Wdiscarded_qualifiers, "argument %d "
 		       "of %qE discards %<const%> qualifier", x + 1,
 		       function);
 	  }
@@ -7651,7 +7651,7 @@ get_atomic_generic_size (location_t loc, tree function,
 		return 0;
 	      }
 	    else
-	      pedwarn (loc, OPT_Wincompatible_pointer_types, "argument %d "
+	      pedwarn (loc, OPT_Wdiscarded_qualifiers, "argument %d "
 		       "of %qE discards %<volatile%> qualifier", x + 1,
 		       function);
 	  }

base-commit: da70c5b17123b7c81155ef03fb4591b71a681344


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-12-18 18:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-17 15:38 [PATCH] c-family: Use -Wdiscarded-qualifiers for ignored qualifiers in __atomic_* Florian Weimer
2023-12-18  0:02 ` Jonathan Wakely
2023-12-18 18:22 ` Joseph Myers

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).