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.9 required=3.0 tests=AWL,BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,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 8BFE71F461 for ; Mon, 9 Sep 2019 14:06:02 +0000 (UTC) Received: from localhost ([::1]:57188 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i7KIq-0004rw-WD for normalperson@yhbt.net; Mon, 09 Sep 2019 10:06:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37248) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i7KIl-0004p0-NY for bug-gnulib@gnu.org; Mon, 09 Sep 2019 10:05:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i7KIk-0004gW-KM for bug-gnulib@gnu.org; Mon, 09 Sep 2019 10:05:55 -0400 Received: from mo6-p00-ob.smtp.rzone.de ([2a01:238:20a:202:5300::3]:30707) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1i7KIj-0004ev-Vf for bug-gnulib@gnu.org; Mon, 09 Sep 2019 10:05:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1568037949; 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=FY6yjL+FvIFM0abrqTUp0LBtp1zEFXxC6K+tIrl/Zyw=; b=W+iZJYBEUlTeYqwPYkgGN7a/7Lb9oDLoJlijCKSjVcSRrEqW0DrvEFu0eBUdUjxRp4 L9hg1mW9sQpNvPVJKPGu6BWJESbsBY+4Haa8hM62i3naNv61nYFnj1xgfqV1TuVmW52u 2v0zGI9VIn2WxysqmjYFj4xz/hAx54At3SqFjYk/hMBrtRsnRikCahI79uD0cFYeSlWY zUfXNeMXEciRDkl4YqIi7dnN0qNNm8eiRYDD//xqo11bX4wkFl+nU9Wrp0OGZyKXDPnH MPPl4Kv23Y/kW1hkVBu/DfM8uJ5Mkm+mFiCy3UsHTi1OmCXR3NNy3gq1CTPWLNOscZWN 9bKA== X-RZG-AUTH: ":Ln4Re0+Ic/6oZXR1YgKryK8brlshOcZlIWs+iCP5vnk6shH+AHjwLuWOGaf0zJZW" X-RZG-CLASS-ID: mo00 Received: from bruno.haible.de by smtp.strato.de (RZmta 44.27.0 DYNA|AUTH) with ESMTPSA id U0b0dfv89E5hASC (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (curve secp521r1 with 521 ECDH bits, eq. 15360 bits RSA)) (Client did not present a certificate); Mon, 9 Sep 2019 16:05:43 +0200 (CEST) From: Bruno Haible To: bug-gnulib@gnu.org Subject: Re: hash: provide hash_xinitialize Date: Mon, 09 Sep 2019 16:05:42 +0200 Message-ID: <3851075.JUabCdIDmM@omega> User-Agent: KMail/5.1.3 (Linux/4.4.0-159-generic; KDE/5.18.0; x86_64; ; ) In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a01:238:20a:202:5300::3 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: Akim Demaille , Jim Meyering Errors-To: bug-gnulib-bounces+normalperson=yhbt.net@gnu.org Sender: "bug-gnulib" Hi Akim, > * modules/hash (Depends-on): Add xalloc. > * lib/hash.h, lib/hash.c (hash_xinitialize): New. This patch produces gnulib-tool warnings: $ ./gnulib-tool --test hash gnulib-tool: warning: module hash depends on a module with an incompatible license: error gnulib-tool: warning: module hash depends on a module with an incompatible license: getprogname gnulib-tool: warning: module hash depends on a module with an incompatible license: xalloc gnulib-tool: warning: module hash depends on a module with an incompatible license: xalloc-die ... What gnulib-tool is telling you is that the module 'hash' has a license that makes it suitable for use in libraries. Adding a dependency to 'xalloc' to it can't be done in this module, because library code should never call xalloc_die(). The fix is to create a new module, with prefix 'x', that adds the function. You can leave it declared in hash.h; this is not a problem. But it needs to be defined in a different compilation unit. For a model of this idiom, look at the modules 'concat-filename' and 'xconcat-filename'. Bruno