Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp2237508imm; Sat, 23 Jun 2018 12:50:39 -0700 (PDT) X-Google-Smtp-Source: ADUXVKK4JA2nNGcMOxjnmPWEcY8GlKILtphMfef/einN7Aosc/Mu+zOP4hI4ZPhuwPGly/sb4HTs X-Received: by 2002:a17:902:be0d:: with SMTP id r13-v6mr6484951pls.299.1529783439838; Sat, 23 Jun 2018 12:50:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529783439; cv=none; d=google.com; s=arc-20160816; b=qiPuyk1VpnzDzm6/oOmvGPWA9mr4E2/xDk/n8pvXQ7l6RV/v6vQDGhEUd24lbSEjCB LxbAiZzVCdP8925KCZbNwUHOUCrjVnSvgWyJ+f73p/jg+a1VKRhwPFGe+ZwR9m1uiXJU M8BoAEiMqlqfG4m+qjBo5Rvv4KsV0756EkKo31pzJgd5MmHBHlwxbfqP2vrqRYmi6tST 3NkTkh3O+nWS3yGHqb9mmJ1HGdsWp7MsxaPWW79Wy49tYqYxWM4sHZtPR3USbJI7t36R aQVfbPNsX68/CRLPjKm1y16GeAGplCBy4ebVYPpllP3xrdvIaM6ePz9TUg48FZ1uzfFZ Uyig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date :arc-authentication-results; bh=7YUHecV6Al6WMVeTZxVva4bnPyDlSIUCxPmEDW2iZBw=; b=s4tnG1t6QjmjdJ6eA5vRk4LD3SyOMKICCY9FL/r69DAlGA2ZaL8V4CmbCclMUhJNyg XTfTTPiGnE70bk0Ik/T8TpoXKctXW2PpjxfH2kloY5mcYIwDjgLcV0CmwuEKHYAgKAxG MPWBEX1+wmMCphlY7Zn6aQtSIufZkfcLhFcn3W0cHJD4zi9N9LZmhnZyaCyCBRXiHcx1 CV543jPEOcBzdDKZzoiV3wv7mPKNFEclyroIt6vR0VtrBf+t7CFgeZibVvV40qfn1PYZ L1DHNZo0d7yFoaDjmgvqPqhkl70OKws2oDQH+PlhisO1ZJPVua/4FPDQWPDshLQoTZBa rbhg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x2-v6si10281325plv.388.2018.06.23.12.49.46; Sat, 23 Jun 2018 12:50:39 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751836AbeFWTsE (ORCPT + 99 others); Sat, 23 Jun 2018 15:48:04 -0400 Received: from gate.crashing.org ([63.228.1.57]:49567 "EHLO gate.crashing.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751744AbeFWTsD (ORCPT ); Sat, 23 Jun 2018 15:48:03 -0400 Received: from gate.crashing.org (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id w5NJlJnn007635; Sat, 23 Jun 2018 14:47:19 -0500 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id w5NJlHFu007628; Sat, 23 Jun 2018 14:47:17 -0500 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 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.4.2.3i Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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