From patchwork Wed Nov 8 08:53:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 162916 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:aa0b:0:b0:403:3b70:6f57 with SMTP id k11csp780676vqo; Wed, 8 Nov 2023 00:53:50 -0800 (PST) X-Google-Smtp-Source: AGHT+IFNMHoWAhqi1ywVxj3q9hgiqaMKkejAw0lXpdgZjlWon9/pf8yiN6G1DeCYSzi9N+CmtLCC X-Received: by 2002:ac8:7f4e:0:b0:41e:aac3:a6b6 with SMTP id g14-20020ac87f4e000000b0041eaac3a6b6mr1343504qtk.63.1699433629860; Wed, 08 Nov 2023 00:53:49 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1699433629; cv=pass; d=google.com; s=arc-20160816; b=MEIUyjUAD15zvzeWcoeQv/xKBHWgl+tKZcwuNR8ifZzTs0dKOE2TLWjaVk4dUhShzF hAhhYqNRsiG0LjIjeuI+YK7NfvHW7gSreP4VzVPt59gvoyS2Wnd02johwtXcp9SZE2vB yEzM9S+StcRtUgTPvarI6+A7HqD2YqGugMEzbH0bqQhfmzcyKxHE70O5OV/8yvAMsJgA M3IxErF8+o/gxwgtEfaYBvU3knurRIj+fHXC1HRiTJWXN25Vk0y12keyevFAqwQo/ClA gk25LOta6Vq49Z+SUKR0bO60lpYjp1Sb9eZDq24aBrINbFt4IytXFdVwCcelS8m2WY8y KkIA== 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:to:from:dkim-signature:arc-filter :dmarc-filter:delivered-to; bh=CN5FQtTUCOweMhOHrliqGt4pgNpaYHpNH0bSE2Zsoao=; fh=hPrbWPhweUx4V0GV9uXJqbyAzg2ABmTz7kczrAQqMmM=; b=lilUhseUvyOqz0nxxXm+D07oXhX4H/IJ7jy7yzUXXmj59x00xrL9MSJKjqkjO3RsgT jA0LbjFbSGGmcS7n+vIR4MFa0nvPltvu3N+AWCv3FR+LUBH3T+AdbkrBtv1mnHVUltWB Z4gK5ql38Ihcg1qYMo8J3uqgyvNvMt1pfPBAb01uK+IuAqBLOdYgAmICEnmgq1/minRN mQXSWGxqA9QgDgD/i5H30P/z2pjTK10Qrwe5mLu9YZlxJUvlDOb/9tGrTI/vUk+f5cXy 7CwkJJaZjxyJRgcLym314AliLOszVWB6cGI7djzffQ9KAI2ihupkxu0db2DoDiHSd0K/ y2ew== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=G2IKwVcb; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c 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. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id y14-20020a05622a164e00b004181b8ae8edsi1035890qtj.246.2023.11.08.00.53.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Nov 2023 00:53:49 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=G2IKwVcb; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c 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 984C63857718 for ; Wed, 8 Nov 2023 08:53:49 +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 181113858D1E for ; Wed, 8 Nov 2023 08:53:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 181113858D1E 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 181113858D1E 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=1699433606; cv=none; b=woohwtT/orSoddHJBmSzCFOWTiwWKea9Kfzf4uLeZcsIAOIKJpdsonmBCxxaY1snyM/HR3lOIo10bJ1qErqiXb3v1vTLd3mrwFW/vteSyUiqGur15ivWQboAEZivSV7koMnuL0ieaGIEcCRGwY0MdvDrk+EVMefTf1fllE6jhXg= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1699433606; c=relaxed/simple; bh=TA4aRemGMIzyGby3K4XdXHv6C8MkFtqnxhTayqgxPXc=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=CHSRUJX9X9bJNql9YTIYgPbajZ5vK8s2c0eCqXodIFOMOtcLMkx5epPP0wSomBfPGstG8btadXTbfNn4cQx5BPp68iND+BGWun43H9li4q/zSnMkcT2Wa1lj3fiYmiSpXmEsYxUB3mNgTsrujSM+Qcf6DYYJ5wSRQ1a0Y3+9kFE= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1699433604; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=CN5FQtTUCOweMhOHrliqGt4pgNpaYHpNH0bSE2Zsoao=; b=G2IKwVcbtQYQNU+CZKh8KTc6CoCA/r9fbWbiGsNm9sKCTD/2W4/4hI1lN1keD71LpDqxXL hCJ4vSPCOV3mV8UY10PlN6wpU7JDjuFEogXlPx1yKlmzL3NxORoEqhUSp2ME5mirdlu6Du HE2x3986WCVK88tFi+OITv+8HOpo5vE= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-28-TEBReFURPr2pJ9UqX9kOFg-1; Wed, 08 Nov 2023 03:53:23 -0500 X-MC-Unique: TEBReFURPr2pJ9UqX9kOFg-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (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 D1CB23C0C102 for ; Wed, 8 Nov 2023 08:53:22 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.2.16.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 382641121306 for ; Wed, 8 Nov 2023 08:53:22 +0000 (UTC) From: Florian Weimer To: gcc-patches@gcc.gnu.org Subject: [PATCH] gcc.dg/Wmissing-parameter-type*: Test the intended warning Date: Wed, 08 Nov 2023 09:53:20 +0100 Message-ID: <877cmsaanz.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.3 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-10.8 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: 1781985317929892891 X-GMAIL-MSGID: 1781985317929892891 gcc/testsuite/ChangeLog: * gcc.dg/Wmissing-parameter-type.c: Build with -std=gnu89 to trigger the -Wmissing-parameter-type warning and not the default -Wimplicit warning. Also match against -Wmissing-parameter-type. * gcc.dg/Wmissing-parameter-type.c: Likewise. --- gcc/testsuite/gcc.dg/Wmissing-parameter-type-Wextra.c | 4 ++-- gcc/testsuite/gcc.dg/Wmissing-parameter-type.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) base-commit: e9107464bb24f77038ad042ba858abed4ca060c0 diff --git a/gcc/testsuite/gcc.dg/Wmissing-parameter-type-Wextra.c b/gcc/testsuite/gcc.dg/Wmissing-parameter-type-Wextra.c index 37e1a571bda..2cd28a2ecd1 100644 --- a/gcc/testsuite/gcc.dg/Wmissing-parameter-type-Wextra.c +++ b/gcc/testsuite/gcc.dg/Wmissing-parameter-type-Wextra.c @@ -1,7 +1,7 @@ /* Test -Wmissing-parameter-type is enabled by -Wextra */ /* { dg-do compile } */ -/* { dg-options "-Wextra" } */ +/* { dg-options "-std=gnu89 -Wextra" } */ -int foo(bar) { return bar;} /* { dg-warning "type of 'bar' defaults to 'int'" } */ +int foo(bar) { return bar;} /* { dg-warning "type of 'bar' defaults to 'int' \\\[-Wmissing-parameter-type\\\]" } */ diff --git a/gcc/testsuite/gcc.dg/Wmissing-parameter-type.c b/gcc/testsuite/gcc.dg/Wmissing-parameter-type.c index 8ec94e2caf7..b25e8d21602 100644 --- a/gcc/testsuite/gcc.dg/Wmissing-parameter-type.c +++ b/gcc/testsuite/gcc.dg/Wmissing-parameter-type.c @@ -1,6 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-Wmissing-parameter-type" } */ +/* { dg-options "-std=gnu89 -Wmissing-parameter-type" } */ -int foo(bar) { return bar; } /* { dg-warning "type of 'bar' defaults to 'int'" } */ +int foo(bar) { return bar; } /* { dg-warning "type of 'bar' defaults to 'int' \\\[-Wmissing-parameter-type\\\]" } */