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-ASN: AS22989 209.51.188.0/24 X-Spam-Status: No, score=-3.7 required=3.0 tests=AWL,BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,SPF_HELO_PASS,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 D756D1F8C6 for ; Mon, 28 Jun 2021 00:31:30 +0000 (UTC) Received: from localhost ([::1]:60154 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lxfBS-0007Wo-0R for normalperson@yhbt.net; Sun, 27 Jun 2021 20:31:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57316) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lxfBK-0007We-5C for bug-gnulib@gnu.org; Sun, 27 Jun 2021 20:31:22 -0400 Received: from mo4-p00-ob.smtp.rzone.de ([85.215.255.22]:29076) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lxfBB-0005Zu-KI for bug-gnulib@gnu.org; Sun, 27 Jun 2021 20:31:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1624840269; s=strato-dkim-0002; d=clisp.org; h=Message-ID:Date:Subject:To:From:Cc:Date:From:Subject:Sender; bh=DzyjM9OytZILhXDpw8ywkyPR6gehXByswIVG/1SeBpQ=; b=W5QWpIkUz1a0hy7wJd2sN3lZC/CntY5hvChXNZ9AydiEGhXSK6i3iaTdYakFarwC7U L5dbIRb0pVYO+qBk8s+Po351ca0mFC796NI0zSSSpI/XzO4oA8Dx9aZ06Ti5cu9FOkHe IIPUQ9qt7XyH+MOalfYr/JzIA2XDbHLwT2plLGG30g4h3zNsecMtj5Vj8l0O1Q4JS798 y0XLE0LhAmqAC39GonFMZ/yY30hrwvLU3W1+DhuhBUJzIEdDYRk3N1TY7nTsfQtZfyUL 1vHXCL6oq/LozUiFsY0e6g1uculdP+vo7M2JCB4wOvbAYTORLu26fXcEdv4dx75lDaEO OxKw== Authentication-Results: strato.com; dkim=none X-RZG-AUTH: ":Ln4Re0+Ic/6oZXR1YgKryK8brlshOcZlIWs+iCP5vnk6shH+AHjwLuWOGKf9yfs=" X-RZG-CLASS-ID: mo00 Received: from bruno.haible.de by smtp.strato.de (RZmta 47.27.5 DYNA|AUTH) with ESMTPSA id a03c9ax5S0V9Hpt (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); Mon, 28 Jun 2021 02:31:09 +0200 (CEST) From: Bruno Haible To: bug-gnulib@gnu.org Subject: environ: Fix wrong autoconf test result in C++ mode Date: Mon, 28 Jun 2021 02:31:08 +0200 Message-ID: <1704558.HPmjlsdhla@omega> User-Agent: KMail/5.1.3 (Linux/4.4.0-210-generic; KDE/5.18.0; x86_64; ; ) MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Received-SPF: none client-ip=85.215.255.22; envelope-from=bruno@clisp.org; helo=mo4-p00-ob.smtp.rzone.de 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 autolearn=ham autolearn_force=no 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: , Errors-To: bug-gnulib-bounces+normalperson=yhbt.net@gnu.org Sender: "bug-gnulib" The autoconf test checking if environ is properly declared... produces a wrong result (yes instead of no) in C++ mode, with g++ version 6 or newer and with clang++. The reason is this error message: g++: error: ' environ', declared using anonymous type, is used but never defined clang++: error: variable 'environ' is used but not defined in this translation unit, and cannot be defined in any other translation unit because its type does not have linkage This patch fixes it. 2021-06-27 Bruno Haible environ: Fix wrong autoconf test result in C++ mode. * m4/environ.m4 (gt_CHECK_VAR_DECL): Use a typedef'ed type, not an anonymous type. diff --git a/m4/environ.m4 b/m4/environ.m4 index d971770..ae53291 100644 --- a/m4/environ.m4 +++ b/m4/environ.m4 @@ -1,4 +1,4 @@ -# environ.m4 serial 7 +# environ.m4 serial 8 dnl Copyright (C) 2001-2004, 2006-2021 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -33,7 +33,8 @@ AC_DEFUN([gt_CHECK_VAR_DECL], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[$1 - extern struct { int foo; } $2;]], + typedef struct { int foo; } foo_t; + extern foo_t $2;]], [[$2.foo = 1;]])], [gt_cv_var=no], [gt_cv_var=yes])])