Date: Sun, 10 Apr 2005 07:45:50 -0400 (EDT) From: Daniel Ellard <ellard@eecs.harvard.edu> To: Ulrich Spoerlein <q@uni.de> Cc: freebsd-current@freebsd.org Subject: Re: smbfs bug introduced at smbfs_vnops.c:1.58 Message-ID: <20050410074009.N66651@bowser.eecs.harvard.edu> In-Reply-To: <20050410092417.GA774@galgenberg.net> References: <200504100251.j3A2pLEH055107@sana.init-main.com> <20050410092417.GA774@galgenberg.net>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, 10 Apr 2005, Ulrich Spoerlein wrote: > Date: Sun, 10 Apr 2005 11:24:17 +0200 > From: Ulrich Spoerlein <q@uni.de> > 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050410074009.N66651>