smbfs bug introduced at smbfs_vnops.c:1.58

Ulrich Spoerlein q at uni.de
Sun Apr 10 02:24:30 PDT 2005


On Sun, 10.04.2005 at 11:51:21 +0900, takawata at 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
% icc -Wbrief -Wall foo.c
foo.c(3): remark #592: variable "a" is used before its value is set
% tdfc2 -Wall foo.c >/dev/null
"foo.c", line 2: Warning:
  [ISO C90 6.6.2]: Variable 'a' may be used without being set.

"foo.c", line 4: Warning:
  [ISO C90 6.6.2]: Variable 'a' not used since previous assignment.
% lint -i foo.c
foo.c(3): warning: a may be used before set [158]
% splint foo.c
foo.c: (in function main)
foo.c:3:3: Variable a used before definition


Any magical flags for gcc I'm missing?

Ulrich Spörlein
-- 
 PGP Key ID: F0DB9F44				Encrypted mail welcome!
Fingerprint: F1CE D062 0CA9 ADE3 349B  2FE8 980A C6B5 F0DB 9F44
Ok, which part of "Ph'nglui mglw'nafh Cthulhu R'lyeh wgah'nagl fhtagn."
didn't you understand?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-fs/attachments/20050410/091b3fb1/attachment.bin


More information about the freebsd-fs mailing list