From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 102963 invoked by alias); 19 May 2017 22:56:07 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 102944 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.1 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM autolearn=no version=3.3.2 spammy=Hx-languages-length:1059 X-HELO: mail-wr0-f175.google.com Received: from mail-wr0-f175.google.com (HELO mail-wr0-f175.google.com) (209.85.128.175) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 19 May 2017 22:56:05 +0000 Received: by mail-wr0-f175.google.com with SMTP id w50so23979470wrc.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=gSNUA64JmuysWcTVvKLkjs3KVad5lArdlxWL3tDSmIql2z+bQMD4ixU5ArJc18CH/S lnUC/VNUFPdf1vs1WuGr9B8+GIUU0F1STXAqRYeZ0F+V5CRkZwM9TQf1JgSjGuP/ulAU yZ/+UrDS6w6yrL0uFADQ9osLTGaONtgWraTiPmzy29umkvfMGJjWdDDwSqsWMtyiJ82z 7whF9C9KUr5yj8Wiv60UvdXrpKr02UQqKDsKhE98I0sQ/uYtnGnls56VFq2IgQHmUlW8 6fr58Vx4+/7QpaClPZczF5tpEYdnpVU8hB2B4Wx/xmWxyAQA6wBnBTzJnp+lCvWpdzxh WMpA== X-Gm-Message-State: AODbwcDNjOqkYZbD6qc/ZmzypSvbRw3PhfSq11g9pmcNI06C0xrH73Ft OC8+OIwexMA6rDDe 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 23:22: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/msg01621.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