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, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, 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 25E501F5AE for ; Wed, 9 Jun 2021 00:41:14 +0000 (UTC) Received: from localhost ([::1]:37902 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lqmHQ-0002Ot-OQ for normalperson@yhbt.net; Tue, 08 Jun 2021 20:41:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37734) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lqmHM-0002Oh-DJ for bug-gnulib@gnu.org; Tue, 08 Jun 2021 20:41:09 -0400 Received: from vmicros1.altlinux.org ([194.107.17.57]:46160) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lqmHK-0001Hv-9O for bug-gnulib@gnu.org; Tue, 08 Jun 2021 20:41:08 -0400 Received: from mua.local.altlinux.org (mua.local.altlinux.org [192.168.1.14]) by vmicros1.altlinux.org (Postfix) with ESMTP id A2A7372C8B0; Wed, 9 Jun 2021 03:41:02 +0300 (MSK) Received: by mua.local.altlinux.org (Postfix, from userid 508) id 908707CF722; Wed, 9 Jun 2021 03:41:02 +0300 (MSK) Date: Wed, 9 Jun 2021 03:41:02 +0300 From: "Dmitry V. Levin" To: Bruno Haible Subject: Re: warnings in unit tests Message-ID: <20210609004102.GA18692@altlinux.org> References: <15897619.AQZsorJ5YP@omega> <2113844.jgEgOJX5uS@omega> <2086778.xA2Ij3oMRU@omega> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2086778.xA2Ij3oMRU@omega> Received-SPF: pass client-ip=194.107.17.57; envelope-from=ldv@altlinux.org; helo=vmicros1.altlinux.org X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-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: , Cc: bug-gnulib@gnu.org, Jim Meyering Errors-To: bug-gnulib-bounces+normalperson=yhbt.net@gnu.org Sender: "bug-gnulib" On Tue, Jun 08, 2021 at 10:56:33AM +0200, Bruno Haible wrote: > Jim Meyering wrote: > > I can live without -Wmissing-prototypes in gnulib tests, but I still > > remember times where using that option exposed a real bug. > > -Wmissing-prototypes typically exposes real bugs when a program is composed > of several compilation units. Unit tests are typically a single compilation > unit plus libtests.a, and libtests.a being built from modules with .h / .c > combinations it does not have the kind of bug that -Wmissing-prototypes can > detect. 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. In case of recurse_1(), the function isn't declared static for a specific reason that isn't obvious for casual readers. In such cases it's usually a good idea to add a comment explaining why this case is different from the common pattern. -- ldv