From owner-freebsd-current@FreeBSD.ORG Sun Apr 10 11:46:02 2005 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 49C8D16A4CE; Sun, 10 Apr 2005 11:46:02 +0000 (GMT) Received: from mail.eecs.harvard.edu (bowser.eecs.harvard.edu [140.247.60.24]) by mx1.FreeBSD.org (Postfix) with ESMTP id BB10D43D2F; Sun, 10 Apr 2005 11:46:01 +0000 (GMT) (envelope-from ellard@eecs.harvard.edu) Received: from localhost (localhost.eecs.harvard.edu [127.0.0.1]) by mail.eecs.harvard.edu (Postfix) with ESMTP id 2AF0354C865; Sun, 10 Apr 2005 07:45:51 -0400 (EDT) Received: from mail.eecs.harvard.edu ([127.0.0.1]) by localhost (bowser.eecs.harvard.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 68484-04; Sun, 10 Apr 2005 07:45:51 -0400 (EDT) Received: by mail.eecs.harvard.edu (Postfix, from userid 465) id E3F1C54C66F; Sun, 10 Apr 2005 07:45:50 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mail.eecs.harvard.edu (Postfix) with ESMTP id E12F754C543; Sun, 10 Apr 2005 07:45:50 -0400 (EDT) Date: Sun, 10 Apr 2005 07:45:50 -0400 (EDT) From: Daniel Ellard To: Ulrich Spoerlein In-Reply-To: <20050410092417.GA774@galgenberg.net> Message-ID: <20050410074009.N66651@bowser.eecs.harvard.edu> References: <200504100251.j3A2pLEH055107@sana.init-main.com> <20050410092417.GA774@galgenberg.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at eecs.harvard.edu X-Mailman-Approved-At: Sun, 10 Apr 2005 11:48:43 +0000 cc: freebsd-fs@freebsd.org cc: bp@freebsd.org cc: freebsd-current@freebsd.org Subject: Re: smbfs bug introduced at smbfs_vnops.c:1.58 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Apr 2005 11:46:02 -0000 On Sun, 10 Apr 2005, Ulrich Spoerlein wrote: > Date: Sun, 10 Apr 2005 11:24:17 +0200 > From: Ulrich Spoerlein > To: takawata@jp.freebsd.org > Cc: freebsd-fs@freebsd.org, bp@freebsd.org, jeff@freebsd.org, > freebsd-current@freebsd.org > Subject: Re: smbfs bug introduced at smbfs_vnops.c:1.58 > > On Sun, 10.04.2005 at 11:51:21 +0900, takawata@jp.freebsd.org wrote: > > This is caused by uninitialized vp. > > The compiler should warn about this. But something fishy is going on ... > > foo.c: > int main(void) { > int a; > a+=1; > return (0); > } > > % gcc -O -W -Wall -Wuninitialized -Winit-self foo.c Certainly this is undesireable, but from what I can tell this happens because "a" is a dead variable and removed. (Look at the asm output and you'll see what I mean.) So it's debatable whether this is a bug. If you change the -O to -g, then the code for "a" is not removed -- but there's still no warning. I think this is a bug, because if the expression wasn't an innocuous a+=1 it could be a real problem if the variable wasn't removed. But people will also argue about this.. -Dan