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, NICE_REPLY_A,RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL, 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 2958D1F5AE for ; Thu, 10 Jun 2021 20:05:45 +0000 (UTC) Received: from localhost ([::1]:54392 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lrQvv-0002r3-W8 for normalperson@yhbt.net; Thu, 10 Jun 2021 16:05:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54236) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lrQvr-0002pb-7z for bug-gnulib@gnu.org; Thu, 10 Jun 2021 16:05:39 -0400 Received: from mo4-p01-ob.smtp.rzone.de ([85.215.255.51]:27143) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lrQvo-00011J-5E for bug-gnulib@gnu.org; Thu, 10 Jun 2021 16:05:39 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1623355533; cv=none; d=strato.com; s=strato-dkim-0002; b=kWpQ30udb8RIMGffuIbSwbIPE5i94CGj1NhWvj9sNWV78ARD9ET59VQO9vHoZooMez zBIgiZRcPhRD1bugFb/59m3PxKomt6LCkIJp56NVH7WVFqfgIRVCLpXZYa9VpIZ4XvW9 hN922Khux1rnPiqcrF71HQeql7YCiHiZwKuDj12aNuKOyW+dPbNeZLKJhcyFkDB+eQ6z iqXrfVWFnkqBYPTM3LHD6vjKvojPk9+6Tny/gU/FBn91m7ZGYhtNhfRLYcqLPL7WwSfP K4B55qY61IL/XnAdBt407CNvbTsqmL9V3qWSynaxmhJ0RWX4lGxLUHBgwEO2h/x35hjr vyhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; t=1623355533; s=strato-dkim-0002; d=strato.com; h=References:In-Reply-To:Message-ID:Date:Subject:To:From:Cc:Date:From: Subject:Sender; bh=sCD28Lh5Uof7283yG6piR9TvyASedKTjJ21V081rc4U=; b=fAHYyjVOtjbkheenYMW3ArJbUKi7WdA5X3TQnNlUmM37Z9rj5qrNxXcfdbkTQvHPpn 5vKU4+uBjSD9YlvZBUD8XvreXPQvX1Ou2lMLjc/I//BRO+0IjcnAGOmhzOF70vLHba01 vNkd0ZrcLMhfw/JOasINhzvADGc8DTSOqBPrgpuHIPE3t9NB/XKoYRgPz7vFmG/RElBK idNmcR/IWF2Hjt4/OLszD/hGFpRErnyuO7hepFaUBPj0/Xan+Z79ineNpskbbXR3+Gbd 4lWWptqx50t6JyLJjSQ1QIGMJNXfjq3qtUqXu9IKC5RUUTBKpAdL+l5BKScT2SnIMKMc 4IPg== ARC-Authentication-Results: i=1; strato.com; dkim=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1623355533; s=strato-dkim-0002; d=clisp.org; h=References:In-Reply-To:Message-ID:Date:Subject:To:From:Cc:Date:From: Subject:Sender; bh=sCD28Lh5Uof7283yG6piR9TvyASedKTjJ21V081rc4U=; b=XCNHMhhEMPAAo4PS6jISDwY9TyTyh40/fPis9txEb7MRMLbA8rFhVKzSLFQSO7jhLz J6NYR2SWa0plZuRfIjc9WlEN4MDyHeR1psSKxvKzIbguCAwq79LC6P4ckkPADfPfvSGF 5LGfvlYs91yBif0XQySwmfx0wkP0DcuLHULzn25nX6GtRQIMJ3pX1363ig8M2hx5HODX Z7cgMo4vkYySl3cGE+yDJjlRpz2jplJoYgUvau96ZoJ5qIvm65RH1pRVsH35Hk+hlD3H XCpdj6DvIo3W+WHFGaS+S0v02RL8VTunuObmw2wuVbvVgTA/Q3sFyCfwMLjbYZCtqMI1 ulKA== Authentication-Results: strato.com; dkim=none X-RZG-AUTH: ":Ln4Re0+Ic/6oZXR1YgKryK8brlshOcZlIWs+iCP5vnk6shH+AHjwLuWOHqf3z5NW" X-RZG-CLASS-ID: mo00 Received: from bruno.haible.de by smtp.strato.de (RZmta 47.27.2 DYNA|AUTH) with ESMTPSA id q0869dx5AK5Wj26 (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); Thu, 10 Jun 2021 22:05:32 +0200 (CEST) From: Bruno Haible To: "Dmitry V. Levin" , bug-gnulib@gnu.org Subject: Re: warnings in unit tests Date: Thu, 10 Jun 2021 22:05:32 +0200 Message-ID: <3760922.z8YlfvkdsK@omega> User-Agent: KMail/5.1.3 (Linux/4.4.0-210-generic; KDE/5.18.0; x86_64; ; ) In-Reply-To: <20210609004102.GA18692@altlinux.org> References: <15897619.AQZsorJ5YP@omega> <2086778.xA2Ij3oMRU@omega> <20210609004102.GA18692@altlinux.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Received-SPF: none client-ip=85.215.255.51; envelope-from=bruno@clisp.org; helo=mo4-p01-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, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, 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" Dmitry V. Levin wrote: > Unlike many other gcc warnings, -Wmissing-prototypes is especially useful > because it doesn't report false positives, so I don't see why one may want > to turn -Wmissing-prototypes off. Sometimes a function in a test is not used on some platforms. What are the possible ways to deal with it? (1) The test function could be put into a #if. This #if condition needs to be updated in some circumstances. => This approach (which I would use in lib/ code) is not zero-cost. (2) The test function can be made 'static'; then we get a compiler warning about an unused function (already with '-Wall', IIRC). (3) The test function can be made global; then we have no warning. But -Wmissing-prototypes makes it into a warning. (4) Then we need to add a prototype to fix that warning. You see my point? These are small considerations each time, but they contribute to making test authoring+maintenance a hassle. And they have no benefit (as I said, in a test that consists of a single compilation unit, linked against one or more .a files). Bruno