From patchwork Fri Oct 28 17:57:15 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Gabriel F. T. Gomes" X-Patchwork-Id: 688575 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3t5BML4BJGz9t0Z for ; Sat, 29 Oct 2016 04:58:38 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b=V2x+8EMY; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:in-reply-to:references :message-id; q=dns; s=default; b=mdmfAPuAGPPvzINSZboF+O7d3g0rBpk HZ9cefaWTeaH3h7uqSiUL85SNgSdf9fHIyJ8mplhpExIIGM0F9RLbq0DQiPv2uuz vCXxmlVIyUenWWGzvq07c+iVinMs3e7s2eFCQ2n9BDaisw29bjbIIKoqX6TFNr6m puz7QI5eauVk= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:in-reply-to:references :message-id; s=default; bh=Pr1qO6zX3FH/aRwJodpPDlxSTCs=; b=V2x+8 EMYoWlXHlscNfvob6chkhN+wskPj/12gOlQd601nhUfCj1BQqockiwXKMC6JOyPa 6R8dIhB1ngPe6zifBJYOLcex5tmJYEFs10w0OPvGbsbtQTrIB9yBwTPw6shfOJMF WB1eM0qfFE8bTd4mSYgN0WPvfawLBCRcJS+l+M= Received: (qmail 19599 invoked by alias); 28 Oct 2016 17:58:31 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 18971 invoked by uid 89); 28 Oct 2016 17:58:30 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=AWL, BAYES_00, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 spammy=gftg@linux.vnet.ibm.com, sk:gftgli, statclass, gftglinuxvnetibmcom X-HELO: mx0a-001b2d01.pphosted.com From: "Gabriel F. T. Gomes" To: fweimer@redhat.com Cc: libc-alpha@sourceware.org Subject: [PATCH v2] Fix warning caused by unused-result in bug-atexit3-lib.cc Date: Fri, 28 Oct 2016 15:57:15 -0200 In-Reply-To: <46c460c8-f171-2f05-5af5-850782196316@redhat.com> References: <46c460c8-f171-2f05-5af5-850782196316@redhat.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16102817-1523-0000-0000-0000023FD43D X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16102817-1524-0000-0000-0000298C091E Message-Id: <1477677435-21029-1-git-send-email-gftg@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2016-10-28_11:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1609300000 definitions=main-1610280303 Changes since v1: - Copy write_message from test-skeleton.c to dlfcn/bug-atexit3-lib.cc. - Replace calls to write with calls to write_message. ---8<--- The test case dlfcn/bug-atexit3-lib.cc calls write and doesn't check the result. When building with GCC 6.2, this generates a warning in 'make check', which is treated as an error. This patch replaces the call to write with a call to write_message. Tested for powerpc64le. 2016-10-28 Gabriel F. T. Gomes * dlfcn/bug-atexit3-lib.cc (write_message): New function, copied from test-skeleton.c. (statclass): Replace calls to write with calls to write_message. --- dlfcn/bug-atexit3-lib.cc | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/dlfcn/bug-atexit3-lib.cc b/dlfcn/bug-atexit3-lib.cc index 3d01ea8..aba7720 100644 --- a/dlfcn/bug-atexit3-lib.cc +++ b/dlfcn/bug-atexit3-lib.cc @@ -1,14 +1,22 @@ #include +#include + +static void +write_message (const char *message) +{ + ssize_t unused __attribute__ ((unused)); + unused = write (STDOUT_FILENO, message, strlen (message)); +} struct statclass { statclass() { - write (1, "statclass\n", 10); + write_message ("statclass\n"); } ~statclass() { - write (1, "~statclass\n", 11); + write_message ("~statclass\n"); } };