Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 1 May 2001 15:30:28 +1000 (EST)
From:      Bruce Evans <bde@zeta.org.au>
To:        Poul-Henning Kamp <phk@critter.freebsd.dk>
Cc:        cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/sys/fs/hpfs hpfs_vnops.c 
Message-ID:  <Pine.BSF.4.21.0105011527590.32403-100000@besplex.bde.org>
In-Reply-To: <58258.988693765@critter>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 1 May 2001, Poul-Henning Kamp wrote:

> In message <Pine.BSF.4.21.0105011323010.31663-100000@besplex.bde.org>, Bruce Ev
> ans writes:
> >>   Modified files:
> >>     sys/fs/hpfs          hpfs_vnops.c 
> >>   Log:
> >>   Uncut&paste som bogus use of VOP_BMAP in hpfs::VOP_STRATEGY.
> >>   
> >>   At the same time, eliminate uninitialized use of a vnode
> >>   pointer.  Interesting GCC didn't spot this.
> >
> >This is because the pointer was supposed to be, and was, initialized by
> >VOP_BMAP().  gcc must assume that foo(&bar) initializes `bar'.
> 
> But VOP_BMAP() was not called in all cases:

I see.  gcc doesn't even spot the error when the function that might
initialize the variable is _never_ called:

---
void foo(int *);

int
main(void)
{
	int x;

	if (0)
		foo(&x);
	return (x);
}
---

Bruce


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0105011527590.32403-100000>