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, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,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 BB6381F5AE for ; Tue, 8 Jun 2021 01:45:53 +0000 (UTC) Received: from localhost ([::1]:36106 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lqQoS-0002xw-RH for normalperson@yhbt.net; Mon, 07 Jun 2021 21:45:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56092) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lqQoP-0002xk-Su for bug-gnulib@gnu.org; Mon, 07 Jun 2021 21:45:49 -0400 Received: from mail-yb1-f179.google.com ([209.85.219.179]:34486) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lqQoN-0007cU-A3 for bug-gnulib@gnu.org; Mon, 07 Jun 2021 21:45:49 -0400 Received: by mail-yb1-f179.google.com with SMTP id i6so13189538ybm.1 for ; Mon, 07 Jun 2021 18:45:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=MVuf6Bxnb3rL/pDXcgwnnYIyg19cgXO6ZHnOqeCLJDw=; b=e6CY3gMMo9s1/ATYRRZ3L8h+U8uVbWoLo5a0qY1A3SI3lEEb9isSZaAREg3uAfZ63g sDWFdUUllgGTl9uUoB+nQAVyN0WSLPmC6HtG0NnpGVueM/s71f5l6i7D7wac0dUVUW+h UeWe8qfk+LrP/vrskKSy+ZuC2eaVW71LblSjaNDeE0g3GkSSy/ZZEzFNytd9s9Q01tOs 7Ep9UJNjo5IS7rF1lR2EXipSLruI6wken2BY02iOKUq+fE8/8f/tlcgY3/Zm5fbZEQqH CnjMK6bWIF3tuFP2Cr/B4/DIZhgmwwKvnAcqDRKbwd8WUDIzDbaUO1pGN4/h2S5s5VSQ 9JCw== X-Gm-Message-State: AOAM532HWEVkhN5bPEbX2NZqV0SSqj4yPsgoSvGu3bp7VYanuDC2eKhC r8uW/0HVgU8L9qtIdjnzezzuLBCpptZmvKEBHAM= X-Google-Smtp-Source: ABdhPJz0Rp2u4xOK/EdEcCCNajbaIRRqswi7XOb7s8ODQ3lvq5nkjHsN5YUh6fqV5mqy0n+Y6j/2sMxLOCR0Xv8Pf4Q= X-Received: by 2002:a5b:489:: with SMTP id n9mr29556212ybp.45.1623116745381; Mon, 07 Jun 2021 18:45:45 -0700 (PDT) MIME-Version: 1.0 References: <15897619.AQZsorJ5YP@omega> <20210606232756.GA17371@altlinux.org> <2263638.MxO8Z3q26L@omega> <20210607102932.GA24455@altlinux.org> In-Reply-To: <20210607102932.GA24455@altlinux.org> From: Jim Meyering Date: Mon, 7 Jun 2021 18:45:33 -0700 Message-ID: Subject: Re: new module 'sigsegv' To: "Dmitry V. Levin" Content-Type: text/plain; charset="UTF-8" Received-SPF: pass client-ip=209.85.219.179; envelope-from=meyering@gmail.com; helo=mail-yb1-f179.google.com X-Spam_score_int: -13 X-Spam_score: -1.4 X-Spam_bar: - X-Spam_report: (-1.4 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FORGED_FROMDOMAIN=0.248, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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 List" , Bruno Haible Errors-To: bug-gnulib-bounces+normalperson=yhbt.net@gnu.org Sender: "bug-gnulib" On Mon, Jun 7, 2021 at 3:29 AM Dmitry V. Levin wrote: > Hi, > On Mon, Jun 07, 2021 at 02:49:35AM +0200, Bruno Haible wrote: > [...] [...] > > > @@ -183,6 +183,9 @@ main () > > > *(volatile int *) (page + 0x678) = 42; > > > break; > > > case 3: > > > +#if 6 < __GNUC__ > > > +# pragma GCC diagnostic ignored "-Wnull-dereference" > > > +#endif > > > *(volatile int *) 0 = 42; > > > break; > > > case 4: > > > > We shouldn't spend time eliminating warnings from test code. > > > > The goal is to have a good coverage of the lib/* code with unit tests. > > That means, we need to > > - make it easy to write unit tests, > > - not make it time-consuming to maintain them. > > > > Eliminating warnings from lib/* code is useful, to avoid bugs in the > > programs. But eliminating warnings from tests/* code goes against the > > goal of increasing test coverage. Hi Bruno, Isn't this code exceptional enough to merit three lines of warning suppression? I would like to continue to use -Werror with most warning options even in test code, as long as the cost is low. This feels like a very low one-time cost. > > I think the right fix would be that gnulib-tool's --import/--update > > option, when creating a tests directory, adds a $(CFLAG_ALLOW_WARNING) > > to tests/Makefile.am, where CFLAG_ALLOW_WARNING is defined as > > -Wno-error when the compiler is GCC or clang, > > empty otherwise > > Will that work in GNU grep? I would prefer not to exempt all of grep/gnulib's test code from -Werror -Wnull-dereference just to accommodate this one unusual case.