Subject: Re: Warnings in nfsv3 code--buggy gcc?
To: Per Fogelstrom <pefo@enea.se>
From: Allen Briggs <briggs@puma.bevd.blacksburg.va.us>
List: tech-kern
Date: 03/29/1996 08:09:00
> I haven't checked the code you mention but this is usually due to
> some logic flow in the code that the compiler can't easy detect.

In this case (nfs_serv.c, nfs_socket.c, nfs_syscalls.c, and
nfs_vnops.c), the code was something like:

int foo()
{
	u_quad_t	off;

	if (xxx) {
		do stuff
		off = something;
		use off
	}

loop1:
	off = something;
	use off
}

Note that 'off' is u_quad_t in all cases.

I've run into the case you mention a lot, and that doesn't bother me--I
can see how the compiler could miss a lot of reasonable cases.  In
general, though, I believe in coding around at least this warning because
this particular one has caught me on the (rare) occasion...

-allen

-- 
  Allen Briggs - end killing - briggs@bev.net ** MacBSD == NetBSD/mac68k **
   Where does all my time go?  <a href="http://www.netbsd.org/">Guess.</a>