From patchwork Sun Dec 17 15:38:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 180036 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp763981dyi; Sun, 17 Dec 2023 07:38:33 -0800 (PST) X-Google-Smtp-Source: AGHT+IFJC1Xd0fzfCjFXeOl2YHpHCIBu0FxgI9OZ3/n02xXWWNWqIuVxweku0kMfFY+lPJ8sPtrg X-Received: by 2002:a05:622a:148f:b0:423:815f:c14 with SMTP id t15-20020a05622a148f00b00423815f0c14mr20470863qtx.56.1702827513198; Sun, 17 Dec 2023 07:38:33 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1702827513; cv=pass; d=google.com; s=arc-20160816; b=WSqqh09kywRWErxTu0xaHEmum9OMxYz+xrx+pwHoks1Po6C6Z8U5bBYGfMz7Es3aQ1 +rc+Ck/K1XsrXqPvIzVztvmEnxTNKNkbv/m/hULpXKElRNS89le1c5VZCNRjF5xpA2dm v7d1PJ4CX0Bs5KyTZKl8KLdGGPoCOAqaEuNdPSyr+5ruYLz2P7pb5dQNYVIwlBELug7b ynznYt+0EPvjjLqywk6uLmiRZzDR5M3nlS2/Lk1eTkOOKx8+FyXRVC5R8RhYsbxmJTkG J2iTNeuuuFWN8wYfIgLhA+942eoSTNZDKtzpTnkwVpFod8g4RxZJoqghVa31lPDcscml jdcw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:mime-version:user-agent :message-id:date:subject:cc:to:from:dkim-signature:arc-filter :dmarc-filter:delivered-to; bh=ogFaPhK0KCZ+npC4r+dyAGF5xUOTuyf+A7ltADjeSqo=; fh=BOTBd3nUR/j4Pyjej4ZDmy7+z+dlfAzU1weMgvsimDY=; b=XSa3FBXgfgrdiv4z9PJZm7DFFxpjtupGe7F8US+TDHZVM5EH4LDiPRPPHtJSNutpp+ ZGRaXy3CJHRhzMrOhsJDewvokyww4H7EzP9NizSy9JCemMRKXrKWIrgfu8HqeRVIuXkb GTmHR4RDUW0N2ZAZM6cTDRbSbN2hPq1dGuVf/hDu/UpAix7R3TOPLC2cnlHt1clRXX9P Z694onaDrJCw2qMasUKJ7PoQZgzlTNQ4VMsoQGtsX9tPOT3CacrSttjFRrJn29pLR6LT b7NAIv7aMSyebQcRsqjgneVtsuKkCbXrVjP6lWRymyWDuTUG6yEjeYA3WiaYcqb4zH+o QbmA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=UO3yhs9g; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id fi3-20020a05622a58c300b004237f64dec8si13198394qtb.528.2023.12.17.07.38.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 Dec 2023 07:38:33 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=UO3yhs9g; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E54A73858CD1 for ; Sun, 17 Dec 2023 15:38:32 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 8B85B3858D39 for ; Sun, 17 Dec 2023 15:38:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8B85B3858D39 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 8B85B3858D39 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702827491; cv=none; b=uIZP4iwxF+fqq3Ctwc0fCnDWUriQCQT/htSpCFFITpjZ4jlprXYqjLklZz2JPHmTSHRboLstBOa3QkYBEv3QL3CNQh8K3fux0AWhbiISlk11o8zGhm19N17cW2PPCm37q+V4KDQ0xI64okSeu2d6glARCcoAgUn45O/akOjAff0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702827491; c=relaxed/simple; bh=WRHxXxydNvug2DT+04LkQ8bbebqfQzSsxyrh9WEtsBo=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=AVOfdhNq6fluof+gpH8G7VppTRl42MokXqNkVk+yQWnU9LiLZS/lYy18yMf2tZnd2sS7LjLT/LK+7L3qybmd0nTww853LDC/GJ2i66QhRMjOWwEjlHXsRSfIqkV/sNWO0+F4L4f8htrvFivDls8hv2rOfPUBHQoHLZjUnDj/QDw= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1702827490; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type; bh=ogFaPhK0KCZ+npC4r+dyAGF5xUOTuyf+A7ltADjeSqo=; b=UO3yhs9gMwUfj4Yx6KH9f7ZUU1AmMgmkbyMP53sVZ1xZIP652ZOmDRFPL4O4iocDk0Od8l Zm/rXx6bPtlbqAtIIwLUc+CHmAVaYzSBoH8F0ToMHpA8wBT179QTsFNbI/onNVUzVXETR3 P+jJfWD1W0jrkZD4QJ2yCX47Mc3IJYw= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-416-prPI3pJuNHC2Yywy3j_yBw-1; Sun, 17 Dec 2023 10:38:08 -0500 X-MC-Unique: prPI3pJuNHC2Yywy3j_yBw-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 38C35832D64 for ; Sun, 17 Dec 2023 15:38:08 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.39.192.77]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 819622026F95; Sun, 17 Dec 2023 15:38:07 +0000 (UTC) From: Florian Weimer To: gcc-patches@gcc.gnu.org Cc: Jonathan Wakely Subject: [PATCH] c-family: Use -Wdiscarded-qualifiers for ignored qualifiers in __atomic_* Date: Sun, 17 Dec 2023 16:38:05 +0100 Message-ID: <87edfk6dr6.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.3 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-10.6 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785544062331990921 X-GMAIL-MSGID: 1785544062331990921 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(-) base-commit: da70c5b17123b7c81155ef03fb4591b71a681344 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 % 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 % qualifier", x + 1, function); }