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

* Re: [PATCH] c-family: Use -Wdiscarded-qualifiers for ignored qualifiers in __atomic_*
  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
  1 sibling, 0 replies; 3+ messages in thread
From: Jonathan Wakely @ 2023-12-18  0:02 UTC (permalink / raw)
  To: Florian Weimer; +Cc: gcc-patches

On Sun, 17 Dec 2023 at 15:38, Florian Weimer <fweimer@redhat.com> wrote:
>
> 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?

You are correct. I think I forgot about -Wdiscarded-qualifiers at the time.


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

* Re: [PATCH] c-family: Use -Wdiscarded-qualifiers for ignored qualifiers in __atomic_*
  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
  1 sibling, 0 replies; 3+ messages in thread
From: Joseph Myers @ 2023-12-18 18:22 UTC (permalink / raw)
  To: Florian Weimer; +Cc: gcc-patches, Jonathan Wakely

On Sun, 17 Dec 2023, Florian Weimer wrote:

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

OK.

-- 
Joseph S. Myers
joseph@codesourcery.com

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