Message ID | 874jihybsu.fsf@oldenburg.str.redhat.com |
---|---|
State | Accepted |
Headers |
Return-Path: <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce89:0:b0:403:3b70:6f57 with SMTP id p9csp1153493vqx; Mon, 23 Oct 2023 01:37:53 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHIZUpeAefHFf1jMWxXmvqbRoAemB1XIuISDFbaGm4NpmcX2+jPdIGQJNO7ATFGaA8oFjfn X-Received: by 2002:a67:e114:0:b0:457:c743:7bba with SMTP id d20-20020a67e114000000b00457c7437bbamr7324715vsl.2.1698050273568; Mon, 23 Oct 2023 01:37:53 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1698050273; cv=pass; d=google.com; s=arc-20160816; b=pvoaMhyxldEKss+40mKVDisL+AGr/fPfNj+ttylITPbPSNQz0ajxuJbMC62L7oOO8y 5P8+8ACK0WxZ/nA0yakESX9GGx3aTg+lUeL1SJQrjeUnJ/mGIQUMN6zy82t8cFNteYXu J+/nxeMOAc/P8fFXiv8J96V8IbxmNFP3yWd12q1wyd8b1UffKsgzDVZYMakmZ1GdcBWG 9S4kGT69EzeugsVW4Ka+2HxmL+ilE0cFUjizrqK3ZlNjXCYb1Fx+vL4KUiVhGeIUwWat ygar7v8C8m+s4hvqArP+D3aigTsKTycnn+FbdKQlD3HzHU2atfBOPSbyLwHx3NvdJLkL qiMA== 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=43DyQaSl6WBbHI8200J8iF8B39o50wUCLE9gdez4oOI=; fh=hPrbWPhweUx4V0GV9uXJqbyAzg2ABmTz7kczrAQqMmM=; b=zlIruUwOKYa7Sx9jve+vM4F79Y1nfx+YjBooq0RANaXTasPA7+1P+QUHY14zMZ7YlV C17rwo87Rh22tZ4P/EBG2aFZ6qAfOmgZFXjCktyDi5q3PuZWjZZR+g+W7uRuOe2ZJQMW cQgMCpNoqDA6Bz5yovqyfmh0Ld3sOqx2OMmk9B7vREI/iI8lNs9ZN1+Tdw6KEsBcG0DQ eSJJUavK+LKswZ1uyOgzljqfBsoZRAXrVrNlQQF/hTe4Nd+EbjnyV2OpSdQvKutblL/i bukDSGYDlBIGIVUTxTC4wujYEm1kfiqvRgTlyLaGOXg3eNSpeBnG4zOAq/IKyDZnvpla MJLw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=aeIcs4O8; 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 nw7-20020a0562143a0700b0065af5b26469si5335894qvb.386.2023.10.23.01.37.53 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Oct 2023 01:37:53 -0700 (PDT) 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=aeIcs4O8; 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 2C21D385840A for <ouuuleilei@gmail.com>; Mon, 23 Oct 2023 08:37:53 +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.129.124]) by sourceware.org (Postfix) with ESMTPS id 4DF2E3858CDA for <gcc-patches@gcc.gnu.org>; Mon, 23 Oct 2023 08:37:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4DF2E3858CDA 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 4DF2E3858CDA Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698050247; cv=none; b=VrR5nXoT+fUl/0w6mmRJREJf6nDsO3dm1i6Cr1TNjGX507EGeuyk324q2vsJZknROZl+UWd4Hkoqj2mDxabnLq1M9yLg+TKldXfWw2ERlOuQCJdMlht/UqMV2HvjVdLXZ02Dfdop0EKS+VKwD3YvAMCrQq3JOjoNz4J0AOggbm0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698050247; c=relaxed/simple; bh=g+sm6jqnT+PHvy3EzcLdgZp2pXpASKQggg2CP+Fhu+0=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=hEQ3H6SU0b8Dq2vpXnMPvUdIkZp4QRJtIdiiEkh14R83qtj4VPAJ0KD1TWPkB3p38cCM+Bo7FRO60U3tDogfkVJMWCXSzHJtCVLl4hNN5ovyCNw6g9rJ+LypH3cJddI9fDNq+mWVgd5XsOnGC6sByPymgJAV5SStgwC3B8v6oew= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1698050245; 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=43DyQaSl6WBbHI8200J8iF8B39o50wUCLE9gdez4oOI=; b=aeIcs4O8xszvBshK1Ctg2pdbzzb6q98MRB0PAZyXKMVrK084zI/aWDWl/MjNUn3rd1++3q W7TJMvYyPBuFzlP8+WhOnBMUL5CKjSL0Umh0xxvNBbn5LB4Kvu1H75n1SjSVnxcA6HRq66 6jxV8gH7G4Tc/5kiK3Acpp5kQ2deh0A= 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-341-m8u_ldh-NNu5T5Y_--FvgQ-1; Mon, 23 Oct 2023 04:37:23 -0400 X-MC-Unique: m8u_ldh-NNu5T5Y_--FvgQ-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (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 ABF17857CFA for <gcc-patches@gcc.gnu.org>; Mon, 23 Oct 2023 08:37:23 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.2.16.3]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2A8FD1C060AE for <gcc-patches@gcc.gnu.org>; Mon, 23 Oct 2023 08:37:22 +0000 (UTC) From: Florian Weimer <fweimer@redhat.com> To: gcc-patches@gcc.gnu.org Subject: [PATCH v2] gcc.c-torture/execute/builtins/fputs.c: fputs_unlocked prototype Date: Mon, 23 Oct 2023 10:37:21 +0200 Message-ID: <874jihybsu.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.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain 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_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP 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 <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780534763569780721 X-GMAIL-MSGID: 1780534763569780721 |
Series |
[v2] gcc.c-torture/execute/builtins/fputs.c: fputs_unlocked prototype
|
|
Checks
Context | Check | Description |
---|---|---|
snail/gcc-patch-check | success | Github commit url |
Commit Message
Florian Weimer
Oct. 23, 2023, 8:37 a.m. UTC
Current glibc headers only declare fputs_unlocked for _GNU_SOURCE, so define it to obtain an official prototype. Add a fallback prototype declaration for other systems that do not have fputs_unlocked. This seems to the most straightforward approach to avoid an implicit function declaration, without reducing test coverage and introducing ongoing maintenance requirements (e.g.g, FreeBSD added fputs_unlocked support fairly recently). gcc/testsuite/ * gcc.c-torture/execute/builtins/fputs.c (_GNU_SOURCE): Define. (fputs_unlocked): Declare. --- gcc/testsuite/gcc.c-torture/execute/builtins/fputs.c | 4 ++++ 1 file changed, 4 insertions(+) base-commit: 0e29c6f65523dad20068ba69cd03d8f6f82cab41
Comments
On 10/23/23 02:37, Florian Weimer wrote: > Current glibc headers only declare fputs_unlocked for _GNU_SOURCE, > so define it to obtain an official prototype. > > Add a fallback prototype declaration for other systems that do not > have fputs_unlocked. This seems to the most straightforward approach > to avoid an implicit function declaration, without reducing test > coverage and introducing ongoing maintenance requirements (e.g.g, > FreeBSD added fputs_unlocked support fairly recently). > > gcc/testsuite/ > > * gcc.c-torture/execute/builtins/fputs.c (_GNU_SOURCE): > Define. > (fputs_unlocked): Declare. This approach is fine too. OK. jeff
diff --git a/gcc/testsuite/gcc.c-torture/execute/builtins/fputs.c b/gcc/testsuite/gcc.c-torture/execute/builtins/fputs.c index 93fa9736449..a94ea993364 100644 --- a/gcc/testsuite/gcc.c-torture/execute/builtins/fputs.c +++ b/gcc/testsuite/gcc.c-torture/execute/builtins/fputs.c @@ -5,9 +5,13 @@ Written by Kaveh R. Ghazi, 10/30/2000. */ +#define _GNU_SOURCE /* For fputs_unlocked. */ #include <stdio.h> extern void abort(void); +/* Not all systems have fputs_unlocked. See fputs-lib.c. */ +extern int (fputs_unlocked) (const char *, FILE *); + int i; void