From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 41CmF43vTHzF14Y for ; Sun, 24 Jun 2018 05:47:52 +1000 (AEST) Date: Sat, 23 Jun 2018 14:47:16 -0500 From: Segher Boessenkool To: christophe leroy Cc: Mathieu Malaterre , Michael Ellerman , Yisheng Xie , Vaibhav Jain , Nicholas Piggin , linux-kernel@vger.kernel.org, Paul Mackerras , Breno Leitao , linuxppc-dev@lists.ozlabs.org Subject: Re: [PATCH] powerpc/xmon: =?utf-8?Q?avoid_?= =?utf-8?Q?warnings_about_variables_that_might_be_clobbered_by_=E2=80=98lo?= =?utf-8?B?bmdqbXDigJk=?= Message-ID: <20180623194716.GY16221@gate.crashing.org> References: <20180622192718.24242-1-malat@debian.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 In-Reply-To: List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Sat, Jun 23, 2018 at 06:59:27PM +0200, christophe leroy wrote: > > > Le 22/06/2018 à 21:27, Mathieu Malaterre a écrit : > >Move initialization of variables after data definitions. This silence > >warnings treated as error with W=1: > > > > arch/powerpc/xmon/xmon.c:3389:14: error: variable ‘name’ might be > > clobbered by ‘longjmp’ or ‘vfork’ [-Werror=clobbered] > > arch/powerpc/xmon/xmon.c:3100:22: error: variable ‘tsk’ might be > > clobbered by ‘longjmp’ or ‘vfork’ [-Werror=clobbered] > > Is that an invalid warning ? No, both are correct warnings. GCC can not see which functions it only has a declaration of can call longjmp. > Otherwise, I'd expect one to fix the warning, not just cheat on GCC. Yes, the patch seems to change the code in such a way that some versions of GCC will no longer warn. Which does not make to code any more correct. Either restructure the code, or make the var non-automatic, or make it volatile. Segher