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 096491F5AE for ; Mon, 7 Jun 2021 10:29:42 +0000 (UTC) Received: from localhost ([::1]:40886 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lqCVo-0000NC-S9 for normalperson@yhbt.net; Mon, 07 Jun 2021 06:29:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41850) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lqCVl-0000Mo-AC for bug-gnulib@gnu.org; Mon, 07 Jun 2021 06:29:37 -0400 Received: from vmicros1.altlinux.org ([194.107.17.57]:40970) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lqCVj-0007c9-4Q for bug-gnulib@gnu.org; Mon, 07 Jun 2021 06:29:37 -0400 Received: from mua.local.altlinux.org (mua.local.altlinux.org [192.168.1.14]) by vmicros1.altlinux.org (Postfix) with ESMTP id 18AF972C8B0; Mon, 7 Jun 2021 13:29:33 +0300 (MSK) Received: by mua.local.altlinux.org (Postfix, from userid 508) id 00BC67CC8BB; Mon, 7 Jun 2021 13:29:32 +0300 (MSK) Date: Mon, 7 Jun 2021 13:29:32 +0300 From: "Dmitry V. Levin" To: Bruno Haible , Jim Meyering Subject: Re: new module 'sigsegv' Message-ID: <20210607102932.GA24455@altlinux.org> References: <15897619.AQZsorJ5YP@omega> <20210606232756.GA17371@altlinux.org> <2263638.MxO8Z3q26L@omega> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2263638.MxO8Z3q26L@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 Errors-To: bug-gnulib-bounces+normalperson=yhbt.net@gnu.org Sender: "bug-gnulib" Hi, On Mon, Jun 07, 2021 at 02:49:35AM +0200, Bruno Haible wrote: [...] > > -volatile int * > > +static volatile int * > > recurse_1 (int n, volatile int *p) > > { > > if (n < INT_MAX) > > @@ -80,7 +80,7 @@ recurse_1 (int n, volatile int *p) > > return p; > > } > > > > -int > > +static int > > recurse (volatile int n) > > { > > return *recurse_1 (n, &n); > > This part should better not be applied. It may enable compiler optimizations > (now or in the future) that, in the end, turn an endless recursion into an > endless loop. I'm not sure there is any difference left in the modern world of lto-enabled compilers. Anyway, in most cases warnings issued by -Wmissing-prototypes are not related to functions with volatile return types, so making them static shouldn't affect the result. > > @@ -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. > > 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? GNU grep explicitly disables some warnings and enables -Werror for gnulib tests [1][2], so I'd like to ask Jim what's the preferred way of handling this in GNU grep. [1] https://git.savannah.gnu.org/gitweb/?p=grep.git;a=commitdiff;h=v3.6-2-g623008c [2] https://git.savannah.gnu.org/gitweb/?p=grep.git;a=commitdiff;h=v3.6-17-g74cda43 -- ldv