From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 102965 invoked by alias); 19 May 2017 22:56:07 -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 102946 invoked by uid 89); 19 May 2017 22:56:06 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 spammy=Hx-languages-length:1059 X-HELO: mail-wr0-f179.google.com Received: from mail-wr0-f179.google.com (HELO mail-wr0-f179.google.com) (209.85.128.179) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 19 May 2017 22:56:05 +0000 Received: by mail-wr0-f179.google.com with SMTP id w50so23979483wrc.0 for ; Fri, 19 May 2017 15:56:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=jmrlerwpiHWDGg71moeNDwu38O+hM5zD0dSv2lCDvr0=; b=VR4bPPadEFOandPIt5arWDRMo3tC3FOXZg4WdY7vQqLa58p/J5cUiaE/BLjiTFnm2U LBayJ+rwkCKR4UDLvPMHqn7NbJivI9i+fseaN7TrHe8y6j5rSAMAtUDeNO2oy3c5Q22F RwaDoVklgWBE2pBPPOcHcOI49HnTeqT4MCcJcRA0mdKR/rF8E/P2cSDs5fVDRioaxoRn 6p8FBkGfQpcpAH3vwMiRsuIU/AC+RWwDNFradtYcSyBB6qEW+aH9P6oKJbVljpjnLs/q 8lqB9OK8r9DhwDJm9lF6Upv6Ee8kXIFxT5oOQvJPtVEZMb+pHTjR5+MVxhOEoHRdW9+l u0lw== X-Gm-Message-State: AODbwcAfMHFkS8Vgf362vvVs1/zuQaddpDZrSBBnqPRuxBy0CxGLpLdZ eIGxN+ug/TGCcmpLTEsDnQ== X-Received: by 10.223.160.139 with SMTP id m11mr3969830wrm.99.1495234566481; Fri, 19 May 2017 15:56:06 -0700 (PDT) Received: from [192.168.0.102] ([37.189.166.198]) by smtp.gmail.com with ESMTPSA id s29sm3517644wrb.21.2017.05.19.15.56.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 19 May 2017 15:56:05 -0700 (PDT) Subject: Re: MinGW compilation warnings in libiberty's xstrndup.c To: DJ Delorie References: Cc: eliz@gnu.org, gcc-patches@gcc.gnu.org, gdb-patches@sourceware.org From: Pedro Alves Message-ID: <5c5a27d9-b52c-7a08-45bb-1db170d8dd25@redhat.com> Date: Fri, 19 May 2017 22:56: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: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2017-05/txt/msg00472.txt.bz2 On 05/19/2017 11:31 PM, DJ Delorie wrote: > > Right, I meant, libiberty's configure, gcc's configure, binutils' > configure, and gdb's configure, all need to agree on whether strnlen is > a HAVE or a HAVE_DECL type symbol. If they don't, the header can't > provide "one" working solution. > Ah, yeah. AFAICS, all the declaration checks in libiberty.h are HAVE_DECL checks. This suggests to me that this declaration guard should be HAVE_DECL too [1]. BTW, I once proposed a new libiberty.m4 file that all libiberty clients would source so that these checks are all centralized. Here: https://gcc.gnu.org/ml/gcc-patches/2015-02/msg00580.html And follow up here: https://gcc.gnu.org/ml/gcc-patches/2015-02/msg01712.html Leading to (as, gold, ld, gdb and libiberty/ itself converted): https://github.com/palves/gdb/commits/palves/libiberty_m4 I never tried adjusting gcc, but even if it wouldn't work there, it'd still be a net win. Wonder what others think of that approach. Thanks, Pedro Alves