From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 39087 invoked by alias); 28 Oct 2016 13:35:11 -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 39070 invoked by uid 89); 28 Oct 2016 13:35:10 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.3 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx1.redhat.com Subject: Re: [PATCH] Fix warning caused by unused-result in bug-atexit3-lib.cc To: "Gabriel F. T. Gomes" References: <1477659653-9022-1-git-send-email-gftg@linux.vnet.ibm.com> <6916e095-d2bd-20ee-57d9-0f1509cfb389@redhat.com> <20161028113240.2ae7dbef@keller> Cc: libc-alpha@sourceware.org From: Florian Weimer Message-ID: <46c460c8-f171-2f05-5af5-850782196316@redhat.com> Date: Fri, 28 Oct 2016 13:35:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <20161028113240.2ae7dbef@keller> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2016-10/txt/msg00536.txt.bz2 On 10/28/2016 03:32 PM, Gabriel F. T. Gomes wrote: > On Fri, 28 Oct 2016 15:04:13 +0200 > Florian Weimer wrote: > >> On 10/28/2016 03:00 PM, Gabriel F. T. Gomes wrote: >>> 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. >> >> You could use write_message from test-skeleton.c instead. it has a >> proper unused variable guard. > > Is it ok to use write_message in c++ code being built as object? Oh, right, this probably will not work. Bummer. You could copy the function into the .cc file, though. The unused attribute may be needed in the long term. Florian