Re: smbfs bug introduced at smbfs_vnops.c:1.58

From: Ulrich Spoerlein <q_at_uni.de>
Date: Sun, 10 Apr 2005 11:24:17 +0200
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?

Received on Sun Apr 10 2005 - 07:24:30 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:31 UTC