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: 16927 X-Patchwork-Delegate: fweimer@redhat.com 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"); } };