smbfs bug introduced at smbfs_vnops.c:1.58

Jens Schweikhardt schweikh at schweikhardt.net
Sun Apr 10 13:56:12 PDT 2005


...
# > $ cat foo.c
# > int main(void) {
# >   int a;
# >   a+=1;
# >   return a;
# > }
# > $ gcc -O -W -Wall -Wuninitialized -Winit-self foo.c
# > foo.c: In function `main':
# > foo.c:2: warning: 'a' might be used uninitialized in this function
# 
# True, but the compiler should warn about bogus source code, even if the
# resulting object code (depending on optmiziation flags) is valid.

Yes, but this type of warning needs data flow analysis, which IIRC is
documented to need at least -O1. So I suspect the original code may have
been compiled without optimization.

Regards,

	Jens
-- 
Jens Schweikhardt http://www.schweikhardt.net/
SIGSIG -- signature too long (core dumped)


More information about the freebsd-current mailing list