Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 10 Apr 2005 15:48:37 +0200
From:      Ulrich Spoerlein <q@uni.de>
To:        Jens Schweikhardt <schweikh@schweikhardt.net>
Cc:        freebsd-current@freebsd.org
Subject:   Re: smbfs bug introduced at smbfs_vnops.c:1.58
Message-ID:  <20050410134837.GC774@galgenberg.net>
In-Reply-To: <20050410110836.GA1355@schweikhardt.net>
References:  <200504100251.j3A2pLEH055107@sana.init-main.com> <20050410092417.GA774@galgenberg.net> <20050410110836.GA1355@schweikhardt.net>

index | next in thread | previous in thread | raw e-mail

[-- Attachment #1 --]
On Sun, 10.04.2005 at 13:08:36 +0200, Jens Schweikhardt wrote:
> # The compiler should warn about this. But something fishy is going on ...
> # 
> # foo.c:
> # int main(void) {
> #   int a;
> #   a+=1;
> #   return (0);
> # }
> 
> Not so fishy. No warning because -O completely optimizes 'a' away. Try
> this instead:
> 
> $ 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.

IMHO

Let's get back to the bug in smbfs_vnops.c, did the compiler issue a
warning?

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?

[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (FreeBSD)

iD8DBQFCWS61mArGtfDbn0QRAt04AKCVUoCrJ+WV40dYYLkw/7ckoVxmSQCfdmHv
ZqgR9tVrIromvkolqdfnzLI=
=FSaw
-----END PGP SIGNATURE-----
help

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050410134837.GC774>