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.8 required=3.0 tests=AWL,BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,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 24DAB1F5AE for ; Wed, 9 Jun 2021 14:17:40 +0000 (UTC) Received: from localhost ([::1]:59936 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lqz1W-0004fT-Up for normalperson@yhbt.net; Wed, 09 Jun 2021 10:17:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38422) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lqz1S-0004f5-2e for bug-gnulib@gnu.org; Wed, 09 Jun 2021 10:17:34 -0400 Received: from mo4-p00-ob.smtp.rzone.de ([85.215.255.25]:33413) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lqz1P-000326-6B for bug-gnulib@gnu.org; Wed, 09 Jun 2021 10:17:33 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1623248248; cv=none; d=strato.com; s=strato-dkim-0002; b=s52X4YKzdAMuNtRrix1CWMJ6vql9p8+Diq82J3289vNVSte6JbjKoDuj7F0VBLBTSe pfgHzlxWs63dJVdNwyhIUxF3w9EK81IRigyqmT8Ttka7b/+3mfvRc1vofwfhOSMd+HCD 8a51iNyijpiogT1NTrDN25XXZwMrWJs8uYiT4N8ULh8Dl05KWKSxW+HRptB55n4gs9WR p5Lgpuv8Yfcc10ovbPpf78w0mPwUUnT06s0jjmjl6qReHqwPsld9XeHoVKb6jJTUxP5r Rthz+DubW50BgWX9zzjoyVAVuJh2iDVcQLXSyCS8cQsY0UfueTLSUOrusV04aOZ1xaTT LpSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; t=1623248248; s=strato-dkim-0002; d=strato.com; h=References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Cc:Date: From:Subject:Sender; bh=W/+GO9+6bYwaGOKTo3zXQLydAeq9/pfKT//Rz1O7s4c=; b=AMRP1z6Y5gYH2qi8YXV4BdRk+Ph+Lc/dU1P0zcdVV6qpxlGJyTU0B0QIe2o4kfOXNr GrwWqc3j+kmybHounuT75q91Sjxb0KKJgY6ZqjH+xaSgEsBc+MTgueV2zFjxi3B2hSwq hOnIVQTrztKcCb4h+FjM73FIZA6B5B+l4qI7onM+RKB8fLHeapHjsfUo7nRxuE6JGVFS jRsSaUGbg9pFGxpkHJPhC9HdsZCcJDRhH0O4wgQyPC1SmQqfi9F5dpmDJeL8fD2oZpzK k4HkK3AMYegNQs0mYIgyTDZiq7NjObKy5b3uv42J9LxuO4Dl+biahryEbVIJIIQMhax4 LNdw== ARC-Authentication-Results: i=1; strato.com; dkim=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1623248248; s=strato-dkim-0002; d=clisp.org; h=References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Cc:Date: From:Subject:Sender; bh=W/+GO9+6bYwaGOKTo3zXQLydAeq9/pfKT//Rz1O7s4c=; b=CCb8XSNmra5ZeWRHPoAO9rWQy7iTTOzPhxAzoVLuY2gv//Iy1kuYUdLXVLk3EYYrUe Lo4T9MEVjuxqWXuKRgvUPFdHIIXKUdKPicrK72lCuIARiZuGIQVpHgfjS8bQFbX7gbpo 9s6CnqEwOVZ/c+YKazTjiATcUUSPvEBslGuE7f9jeMO9z/hnPrCavqYABAKfyNHqtb3l WKVpqeJGodOwpKpuM1L6gk6D568KeUTfe4UZvTlnGcG38MZWkXvX4Uy1T82qoj63+azO Z0VU85P4bR7u/BM/6JNU/imsWfqT0kpCUllfVSHBbvciM6ofVUn0FjCDFHxnkBhEUonZ EVwg== 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 q0869dx59EHRbs9 (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); Wed, 9 Jun 2021 16:17:27 +0200 (CEST) From: Bruno Haible To: Bernhard Voelker Subject: Re: warnings in unit tests Date: Wed, 09 Jun 2021 16:17:27 +0200 Message-ID: <3014747.zE86cuorZB@omega> User-Agent: KMail/5.1.3 (Linux/4.4.0-210-generic; KDE/5.18.0; x86_64; ; ) In-Reply-To: <95d95bca-0f45-9a93-634f-47bb536d2923@bernhard-voelker.de> References: <15897619.AQZsorJ5YP@omega> <4537093.ULRrrf3QbG@omega> <95d95bca-0f45-9a93-634f-47bb536d2923@bernhard-voelker.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" Received-SPF: none client-ip=85.215.255.25; 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, 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: , Cc: noloader@gmail.com, bug-gnulib@gnu.org Errors-To: bug-gnulib-bounces+normalperson=yhbt.net@gnu.org Sender: "bug-gnulib" Bernhard Voelker wrote: > One little aspect of the tests code is that people might look (also) ther= e to > learn how to use a certain gnulib module, and then copy/paste the code fr= om > there into their projects. Yes, a secondary value of the unit tests is to show how the APIs can be correctly used. (For example, the unit tests of the 'list' and 'hamt' modul= es.) > That's at least true for the good test cases, surely not for those provok= ing errors. > This means it may be worthwhile to have at least the good test cases in a= warning- > free shape (which I think it most often already is). Yes, the parts of the unit tests that exercise the normal use of an API sho= uld normally compile without warnings with '-Wall'. The parts that exercise corner cases (NULL pointer accesses, invalid argume= nts, endless loops, endless recursions, etc.), on the other hand, can produce wa= rnings, from compilers and from static analysis tools. That's one reason why we cannot tolerate '-Werror' on gnulib tests. The other reason is that every package maintainer has their preferred set of warnings =E2=80=94 that's what the 'manywarnings' module is made for =E2=80= =94, but it does not make sense for package maintainers to enforce the absence of certain warnings on code that 1) they don't maintain, 2) does not end up in the binaries produced (installed) by their package. Bruno