From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 115857 invoked by alias); 8 Aug 2018 17:49:04 -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 115556 invoked by uid 89); 8 Aug 2018 17:48:49 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.2 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy=16.04 X-HELO: NAM02-CY1-obe.outbound.protection.outlook.com Received: from mail-cys01nam02on0086.outbound.protection.outlook.com (HELO NAM02-CY1-obe.outbound.protection.outlook.com) (104.47.37.86) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 08 Aug 2018 17:48:47 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=lu4aVrfcWiGGIP5Fchmt1oAGRYvKix+va9xeR/ZU+hY=; b=cLNEGWTUqSpLcPLAf6/IOC4KXz3VHFDN6HVYs7kJZJhSP5WbhGdsFQmPSj1ibk38ccMx65rJv0yL/3bLj8pjnf3SP0tXD649SVeerRrumzoV723f1T6R86vnmYGz/YV1Q5f5yu8Oe31850yKejr+xo7vQuTbX2ZZbg6+dYCCEAA= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Steve.Ellcey@cavium.com; Received: from sellcey-dt.caveonetworks.com (50.233.148.155) by BYAPR07MB5032.namprd07.prod.outlook.com (2603:10b6:a03:5b::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1017.19; Wed, 8 Aug 2018 17:48:44 +0000 Message-ID: <1533750521.31481.18.camel@cavium.com> Subject: Re: gdb build problem (gdb/unittests/scoped_mmap-selftests.c) From: Steve Ellcey Reply-To: sellcey@cavium.com To: Tom Tromey Cc: gdb-patches , simon.marchi@ericsson.com Date: Wed, 08 Aug 2018 17:49:00 -0000 In-Reply-To: <87wot092xy.fsf@tromey.com> References: <1533742957.31481.2.camel@cavium.com> <87wot092xy.fsf@tromey.com> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Return-Path: sellcey@cavium.com Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-SW-Source: 2018-08/txt/msg00171.txt.bz2 On Wed, 2018-08-08 at 11:35 -0600, Tom Tromey wrote: >  > 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); Yes, this patch fixed the build problem I was having.  I was building on Ubuntu 16.04 so I guess that one of the platforms that enables _FORTIFY_SOURCE by default. Steve Ellcey sellcey@cavium.com