From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-3.6 required=3.0 tests=AWL,BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id BB6521F5AE for ; Mon, 29 Jun 2020 22:56:02 +0000 (UTC) Received: from localhost ([::1]:57804 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jq2gz-0001rp-A7 for normalperson@yhbt.net; Mon, 29 Jun 2020 18:56:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46708) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jq2gw-0001rg-E4 for bug-gnulib@gnu.org; Mon, 29 Jun 2020 18:55:58 -0400 Received: from mo4-p00-ob.smtp.rzone.de ([81.169.146.163]:19247) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jq2gt-0001Qi-5e; Mon, 29 Jun 2020 18:55:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1593471350; s=strato-dkim-0002; d=clisp.org; h=References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: X-RZG-CLASS-ID:X-RZG-AUTH:From:Subject:Sender; bh=bu/INHr8S78XdVMEp3plE3/Dg21qX6Zy7Pt6dnZq2Sk=; b=fgBNimlWAkeZMhfmm6ZDsiRBXYnOB81JDfzIHLRN2X3CjJ5TrMiBoxQTmvvc2L69Hh 6C8oW1y/hoZqqNBNxOBRPaFCqrryp6O4Qp7qpjX+Gz+eDTH2HCORdVrR4kF+JEcod4jG qFHlLx00LO1Xe3RFoQ1uXLTWw7+z9TuCzr5DeCbVEFEC01NMs3oPahe6BdfhVS/i7vAf LCNUl2UVV75Kx4TXHUEj5jrRQXhqNsSBEjheDwXbMgxrk3ddDFuxhTEtryGkHNtAwgAk lE2RR8408/tzNohKakTQbXsGBOT1W5rl+pwncguNGfx+9S/0OeWdfqkj5sMIdVA7W0cf te2w== X-RZG-AUTH: ":Ln4Re0+Ic/6oZXR1YgKryK8brlshOcZlIWs+iCP5vnk6shH+AHjwLuWOH6fzxfs=" X-RZG-CLASS-ID: mo00 Received: from bruno.haible.de by smtp.strato.de (RZmta 46.10.5 DYNA|AUTH) with ESMTPSA id R03d1aw5TMtoWCG (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (curve X9_62_prime256v1 with 256 ECDH bits, eq. 3072 bits RSA)) (Client did not present a certificate); Tue, 30 Jun 2020 00:55:50 +0200 (CEST) From: Bruno Haible To: bug-gnulib@gnu.org Subject: Re: Gnulib's alloca.h and MinGW Date: Tue, 30 Jun 2020 00:55:49 +0200 Message-ID: <1928030.008H2qJTyv@omega> User-Agent: KMail/5.1.3 (Linux/4.4.0-179-generic; KDE/5.18.0; x86_64; ; ) In-Reply-To: <83d05h2361.fsf@gnu.org> References: <83d05h2361.fsf@gnu.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Received-SPF: none client-ip=81.169.146.163; envelope-from=bruno@clisp.org; helo=mo4-p00-ob.smtp.rzone.de X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/29 18:55:50 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_PASS=-0.001, SPF_NONE=0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: bug-gnulib@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Gnulib discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eli Zaretskii Errors-To: bug-gnulib-bounces+normalperson=yhbt.net@gnu.org Sender: "bug-gnulib" Hi Eli, > A recent MinGW runtime changed its definition of alloca from an > inline function to a macro. As result, there's a warning when > compiling Gnulib's malloca.c: > > CC malloca.o > In file included from malloca.h:21, > from malloca.c:22: > ./alloca.h:46: warning: "alloca" redefined > 46 | # define alloca __builtin_alloca > | > In file included from ./alloca.h:44, > from malloca.h:21, > from malloca.c:22: > d:\usr\include\alloca.h:81: note: this is the location of the previous definition > 81 | #define alloca( __request ) __builtin_alloca( __request ) > | > > Proposed patch is below. Thanks. Thanks for the report. I like your patch. It is better than the '#undef alloca' solution that I had considered before. 2020-06-29 Bruno Haible alloca-opt: Fix warning on mingw. Reported and solution by Eli Zaretskii in . * lib/alloca.in.h: On mingw, include and then test again whether alloca is defined. diff --git a/lib/alloca.in.h b/lib/alloca.in.h index 73516ca..beb022c 100644 --- a/lib/alloca.in.h +++ b/lib/alloca.in.h @@ -35,13 +35,16 @@ */ #ifndef alloca + /* Some version of mingw have an that causes trouble when + included after 'alloca' gets defined as a macro. As a workaround, + include this first and define 'alloca' as a macro afterwards + if needed. */ +# if defined __GNUC__ && (defined _WIN32 && ! defined __CYGWIN__) && @HAVE_ALLOCA_H@ +# include_next +# endif +#endif +#ifndef alloca # ifdef __GNUC__ - /* Some version of mingw have an that causes trouble when - included after 'alloca' gets defined as a macro. As a workaround, include - this first and define 'alloca' as a macro afterwards. */ -# if (defined _WIN32 && ! defined __CYGWIN__) && @HAVE_ALLOCA_H@ -# include_next -# endif # define alloca __builtin_alloca # elif defined _AIX # define alloca __alloca