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=-4.5 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW,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 5A83A1F466 for ; Mon, 27 Jan 2020 16:01:00 +0000 (UTC) Received: from localhost ([::1]:47272 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iw6os-00084P-TV for normalperson@yhbt.net; Mon, 27 Jan 2020 11:00:58 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:54658) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iw6on-00084G-KR for bug-gnulib@gnu.org; Mon, 27 Jan 2020 11:00:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iw6ok-0006ek-0P for bug-gnulib@gnu.org; Mon, 27 Jan 2020 11:00:53 -0500 Received: from smtpcmd11116.aruba.it ([62.149.156.116]:56505) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1iw6oj-0006dO-Bw for bug-gnulib@gnu.org; Mon, 27 Jan 2020 11:00:49 -0500 Received: from [192.168.159.128] ([212.103.203.10]) by smtpcmd11.ad.aruba.it with bizsmtp id vU0l2100Y0DySFo01U0lCv; Mon, 27 Jan 2020 17:00:47 +0100 Subject: Re: [PATCH] lib/gettext.h: fix warning if gettext is already present To: Bruno Haible References: <20200126181929.38457-1-giulio.benetti@benettiengineering.com> <1852089.F2OspKUfUd@omega> <17178930.OJuyEKsSSM@omega> From: Giulio Benetti Message-ID: Date: Mon, 27 Jan 2020 17:00:45 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: <17178930.OJuyEKsSSM@omega> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aruba.it; s=a1; t=1580140847; bh=YGVjtpdMX20a8Bj7o78jnwMoTmV3/XSqpUgyGyJTA1o=; h=Subject:To:From:Date:MIME-Version:Content-Type; b=Xd+KAiNISuPgLXlar6LY/SWagUX4oLCCt0tntTXFn4QUIyPleZKp9Nj718dNF4oQQ bO/dFfYEZ6U3lQu9aB4faMZNbtsMB/caNpQYke4FyxOoZUAo9kOzUeN+4L8lm8yMPT jvLK0fuj2dbE3383/AnZk7GHk3wfmEWa2GZs5ym6chocbc+eNkCT7lQilcm8f5VvR1 OkPMo0umxgZvyRwKq8xOpZxO4oUS91+f4VhFXqScq244wmqaU2Nr0nldYvWNHaJXge +bQ/VEE2stUay7OhEJjH02akvqURx4EDt6x4fNrG8sXV2nz2wBuKhsg7eTWa2yajfu mG/PhJxj7LrNQ== X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 62.149.156.116 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: bug-gnulib@gnu.org Errors-To: bug-gnulib-bounces+normalperson=yhbt.net@gnu.org Sender: "bug-gnulib" Hi Bruno, On 1/27/20 2:41 AM, Bruno Haible wrote: > Giulio Benetti wrote: >> In my specific case I'm adding package libbytesize >> [1], where they add src/gettext.h > > But libbytesize uses gettext.h as they should: They use the file internally, > without installing it in public locations upon "make install". > > Since you reported a redefinition warning regarding 'gettext_noop', > gettext_noop must have been defined as a macro already elsewhere. Where? gettext_noop() is defined in environment gettext.h and in libbytesize/configure.ac they define: CFLAGS="${CFLAGS} -DENABLE_NLS" without taking into account if we already are in an environment where gettext is already installed. So I think that this is problem, libbytesize should define ENABLE_NLS according to host gettext presence otherwise host gettext could be indirectly included(like in my case) and expose gettext_noop() and when local "gettext.h" is included and ENABLE_NLS is defined(because there are no checks on environment) gettext_noop() will be defined twice. > >> but they define ENABLE_NLS in any case > > Defining ENABLE_NLS several times to the same value 1 is a no-brainer. > It does not produce GCC warnings. Here I meant that in libbytesize they define ENABLE_NLS in configure.c without guarding for host gettext presence. So if you define ENABLE_NLS only once, it's enough to see gettext_noop() redefined, since it's defined in host. Anyway gnulib is correct, the problem to be fixed is in libbytesize and it's not fixed by the PR I've already open, I need to modify configure.ac to emit ENABLE_NLS according to host gettext presence. Sorry for the noise Best and kind regards -- Giulio Benetti Benetti Engineering sas > Bruno >