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-Status: No, score=-5.2 required=3.0 tests=AWL,BAYES_00, 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 694CD1F4B4 for ; Sat, 2 Jan 2021 01:43:28 +0000 (UTC) Received: from localhost ([::1]:41578 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kvVx0-0006Fc-WC for normalperson@yhbt.net; Fri, 01 Jan 2021 20:43:27 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:33978) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kvVwy-0006FC-9M for bug-gnulib@gnu.org; Fri, 01 Jan 2021 20:43:24 -0500 Received: from mout.kundenserver.de ([212.227.126.187]:36979) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kvVwu-00038H-U5 for bug-gnulib@gnu.org; Fri, 01 Jan 2021 20:43:24 -0500 Received: from [192.168.101.10] ([91.12.160.30]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MlbPO-1kCrSO0dbG-00ijdZ; Sat, 02 Jan 2021 02:43:18 +0100 Subject: Re: test-getgroups.c:stringop-overflow warning on newer GCC To: Bruno Haible , bug-gnulib@gnu.org References: <2887419.1QkhuepXuh@omega> From: Bernhard Voelker Message-ID: Date: Sat, 2 Jan 2021 02:43:17 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: <2887419.1QkhuepXuh@omega> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K1:FjShWrxJp+ehePuRWWPzk9onyhHjH18clgPrLZkWmqvJQ0C+UnM K4hheQco7XA/O7i9BjDnEFMbMjKIIi287SXdjQN+Dt0Vc/ZspQ9fXIRgHdYQzcGrmc6TS5h zKXpGDJ3KX9pxlgxc4RfFFovYxGh5+Sc30hQc3MxR485xqiGtkY9b+KN0Oh+IK+0GMC7uk6 9rxPAecDK8yVs+ROdwuGQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:n175AibEBLs=:TjqDc8LS00eau/jxMIpksQ ewq3VNBDVy7t5yo0zPGhYUHInqLqdGyzkkcjWzTFqj3h0sedTGVZrdrzxMp8Sdn5KQZcuEJFG Q6f/i5rwtMC5ZAEmgv6PzkBd13zMDGFUsA0cmAyXB8lyHalPbFKg56ZabOas71fu7VbWuJeVD gcScQVlPv8s67A12WGRgK/AGSe72xcj9T6xb9BQeesoHFkUIuQNp1Cui7XT/d4zZL3f+eIHgv y1xfWJiAGLbLC3LAMnH50voZgNPLeObp2kcLkYyQ7+g4MOaf+UsgOht6K12Lv6Zj5fqRfHyGD fKIalI4En0BuRNThORrKnwxvJMVy4AYuxUgq4GoHx8k7CulZnwmuLOOWhkrh7/dAkwEtyhOUt MORPs4zxPmd1giHEsHQf36eAVDLt5/S+0WI0UpnI5bmnyk/nsE1ZbqBqj4onBCi4KcIIQ24Fu Y9DgzMVx5w== Received-SPF: none client-ip=212.227.126.187; envelope-from=mail@bernhard-voelker.de; helo=mout.kundenserver.de X-Spam_score_int: -45 X-Spam_score: -4.6 X-Spam_bar: ---- X-Spam_report: (-4.6 / 5.0 requ) BAYES_00=-1.9, NICE_REPLY_A=-2.749, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=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" Hi Bruno, On 1/1/21 1:56 PM, Bruno Haible wrote: > Hi Berny, > > Bernhard Voelker wrote in > : >> Newer GCC complains about this test: >> >> $ make test-getgroups.o V=1 >> depbase=`echo test-getgroups.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\ >> gcc -DHAVE_CONFIG_H -DEXEEXT=\"\" -I. -I.. -DIN_FINDUTILS_GNULIB_TESTS=1 -I. -I. -I.. -I./.. -I../gl/lib -I./.. \ >> /gl/lib -g -O2 -MT test-getgroups.o -MD -MP -MF $depbase.Tpo -c -o test-getgroups.o test-getgroups.c &&\ >> mv -f $depbase.Tpo $depbase.Po >> In file included from test-getgroups.c:31: >> test-getgroups.c: In function 'main': >> test-getgroups.c:65:11: warning: argument 1 value -1 is negative [-Wstringop-overflow=] >> 65 | ASSERT (getgroups (-1, NULL) == -1); >> | ^~~~~~~~~~~~~~~~~~~~ > > I can't reproduce this with a testdir created through > ./gnulib-tool --create-testdir --dir=... --single-configure getgroups > and GCC 10.2.0, even with '-Wall' (whereas the GCC invocation that you show does > not invoke any warning options!): yes, this shows up without -Wall here. > $ gcc -DHAVE_CONFIG_H -I. -I.. -DGNULIB_STRICT_CHECKING=1 -DIN_GNULIB_TESTS=1 -I. -I. -I.. -I./.. -I../gllib -I./../gllib -g -O2 -c test-getgroups.c -Wall > (no diagnostics) I reproduced again without -Wall both on my openSUSE Tumbleweed system with gcc (SUSE Linux) 10.2.1 20201202 [revision e563687cf9d3d1278f45aaebd03e0f66531076c9] and on Fedora (in a docker container) with gcc (GCC) 10.2.1 20201125 (Red Hat 10.2.1-9) So it may be an issue with the 10.2.1 version > Also, it's strange that this warning reports to come from -Wstringop-overflow > — whereas 'getgroups' is not a string operation> > So, to me it looks like a bug in the particular GCC version that you are using. > > Under regular circumstances, I would consider adding a #pragma GCC diagnostic, > as you suggest, but not under these circumstances. I'm not sure how to proceed from here. Have a nice day, Berny