From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 105210 invoked by alias); 8 Aug 2018 17:39:29 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 105191 invoked by uid 89); 8 Aug 2018 17:39:28 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-24.9 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy=HContent-Transfer-Encoding:8bit X-HELO: smtp.polymtl.ca Received: from smtp.polymtl.ca (HELO smtp.polymtl.ca) (132.207.4.11) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 08 Aug 2018 17:39:27 +0000 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id w78HdL7c004340 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 8 Aug 2018 13:39:25 -0400 Received: by simark.ca (Postfix, from userid 112) id 206721EF36; Wed, 8 Aug 2018 13:39:21 -0400 (EDT) Received: from simark.ca (localhost [127.0.0.1]) by simark.ca (Postfix) with ESMTP id 87B3A1E52C; Wed, 8 Aug 2018 13:39:18 -0400 (EDT) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Date: Wed, 08 Aug 2018 17:39:00 -0000 From: Simon Marchi To: Tom Tromey Cc: Steve Ellcey , gdb-patches , simon.marchi@ericsson.com Subject: Re: gdb build problem (gdb/unittests/scoped_mmap-selftests.c) In-Reply-To: <87wot092xy.fsf@tromey.com> References: <1533742957.31481.2.camel@cavium.com> <87wot092xy.fsf@tromey.com> Message-ID: X-Sender: simon.marchi@polymtl.ca User-Agent: Roundcube Webmail/1.3.6 X-IsSubscribed: yes X-SW-Source: 2018-08/txt/msg00169.txt.bz2 On 2018-08-08 13:35, Tom Tromey wrote: >>>>>> "Steve" == Steve Ellcey writes: > > Steve> Is anyone else still having a problem building gdb?  I saw the  > Steve> mail about remote.c but I currently get this failure when > Steve> building gdb with gcc 5.4.0 on an aarch64 linux box. > > I haven't seen this, but IIRC some distros enable _FORTIFY_SOURCE by > default, which changes which unused-result warnings are emitted. > > Does the appended work for you? > > I wonder if we should enable _FORTIFY_SOURCE for development builds. > > Tom > > diff --git a/gdb/unittests/scoped_mmap-selftests.c > b/gdb/unittests/scoped_mmap-selftests.c > index d70a56a1862..e9d4afdffc5 100644 > --- a/gdb/unittests/scoped_mmap-selftests.c > +++ b/gdb/unittests/scoped_mmap-selftests.c > @@ -91,7 +91,7 @@ test_normal () > int fd = mkstemp (filename); > SELF_CHECK (fd >= 0); > > - write (fd, "Hello!", 7); > + SELF_CHECK (write (fd, "Hello!", 7) == 7); > close (fd); > > gdb::unlinker unlink_test_file (filename); Oops, sorry for the breakage. Tom's fix LGTM. I think that enabling _FORTIFY_SOURCE can only do some good. Simon