From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 51595 invoked by alias); 28 Oct 2016 13:01:13 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 50368 invoked by uid 89); 28 Oct 2016 13:01:12 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.1 required=5.0 tests=BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW,RCVD_IN_SEMBACKSCATTER autolearn=no version=3.3.2 spammy= X-HELO: mx0a-001b2d01.pphosted.com From: "Gabriel F. T. Gomes" To: libc-alpha@sourceware.org Subject: [PATCH] Fix warning caused by unused-result in bug-atexit3-lib.cc Date: Fri, 28 Oct 2016 13:01:00 -0000 X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16102813-0020-0000-0000-00000257D2BE X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16102813-0021-0000-0000-00003063FFD4 Message-Id: <1477659653-9022-1-git-send-email-gftg@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-10-28_05:,, 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-1610280223 X-SW-Source: 2016-10/txt/msg00524.txt.bz2 The test case dlfcn/bug-atexit3-lib.cc calls write and doesn't check the result. When building with GCC 6.2 from IBM's branch, this generates a warning in 'make check', which is treated as an error. This patch adds a return variable to get rid of the warning and of the error. Tested for powerpc64le. 2016-10-28 Gabriel F. T. Gomes * dlfcn/bug-atexit3-lib.cc (statclass): Assign return of call to write (defined with __wur) to unused variable. --- dlfcn/bug-atexit3-lib.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/dlfcn/bug-atexit3-lib.cc b/dlfcn/bug-atexit3-lib.cc index 3d01ea8..5a7c454 100644 --- a/dlfcn/bug-atexit3-lib.cc +++ b/dlfcn/bug-atexit3-lib.cc @@ -4,11 +4,15 @@ struct statclass { statclass() { - write (1, "statclass\n", 10); + size_t unused_ret; + (void) unused_ret; + unused_ret = write (1, "statclass\n", 10); } ~statclass() { - write (1, "~statclass\n", 11); + size_t unused_ret; + (void) unused_ret; + unused_ret = write (1, "~statclass\n", 11); } }; -- 2.4.11