From owner-freebsd-arch@FreeBSD.ORG Mon Jan 31 18:42:27 2005 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4BA2516A4CE for ; Mon, 31 Jan 2005 18:42:27 +0000 (GMT) Received: from wrzx35.rz.uni-wuerzburg.de (wrzx35.rz.uni-wuerzburg.de [132.187.3.35]) by mx1.FreeBSD.org (Postfix) with ESMTP id 88BB443D4C for ; Mon, 31 Jan 2005 18:42:26 +0000 (GMT) (envelope-from q@uni.de) Received: from wrzx30.rz.uni-wuerzburg.de (wrzx30.rz.uni-wuerzburg.de [132.187.1.30]) by wrzx35.rz.uni-wuerzburg.de (Postfix) with ESMTP id A905DE1012; Mon, 31 Jan 2005 19:42:25 +0100 (CET) Received: from virusscan (localhost [127.0.0.1]) by wrzx30.rz.uni-wuerzburg.de (Postfix) with ESMTP id 8D56F93216; Mon, 31 Jan 2005 19:42:25 +0100 (CET) Received: from wrzx28.rz.uni-wuerzburg.de (wrzx28.rz.uni-wuerzburg.de [132.187.3.28]) by wrzx30.rz.uni-wuerzburg.de (Postfix) with ESMTP id 7A9F9931AC; Mon, 31 Jan 2005 19:42:25 +0100 (CET) Received: from coyote.q.local (wwsx14.win-screen.uni-wuerzburg.de [132.187.253.14]) by wrzx28.rz.uni-wuerzburg.de (Postfix) with ESMTP id F2A80D84A6; Mon, 31 Jan 2005 19:42:24 +0100 (CET) Received: from roadrunner.q.local (roadrunner.q.local [192.168.0.148]) by coyote.q.local (8.13.1/8.13.1) with ESMTP id j0VIgOSw070820; Mon, 31 Jan 2005 19:42:24 +0100 (CET) (envelope-from q@uni.de) Received: from roadrunner.q.local (localhost [127.0.0.1]) by roadrunner.q.local (8.13.1/8.13.1) with ESMTP id j0VIgONe006811; Mon, 31 Jan 2005 19:42:24 +0100 (CET) (envelope-from q@uni.de) Received: (from q@localhost) by roadrunner.q.local (8.13.1/8.13.1/Submit) id j0VIgN6J006810; Mon, 31 Jan 2005 19:42:23 +0100 (CET) (envelope-from q@uni.de) Date: Mon, 31 Jan 2005 19:42:23 +0100 From: Ulrich Spoerlein To: Paul Richards Message-ID: <20050131184223.GG828@galgenberg.net> References: <20050131122609.GA83556@gurney.reilly.home> <90392.1107174969@critter.freebsd.dk> <20050131163117.GE828@galgenberg.net> <20050131165817.GV61409@myrddin.originative.co.uk> <20050131170417.GW61409@myrddin.originative.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050131170417.GW61409@myrddin.originative.co.uk> User-Agent: Mutt/1.5.6i X-Virus-Scanned: by amavisd-new (Rechenzentrum Universitaet Wuerzburg) cc: arch@freebsd.org Subject: Re: c99/c++ localised variable definition X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Jan 2005 18:42:27 -0000 On Mon, 31.01.2005 at 17:04:17 +0000, Paul Richards wrote: > > > % cc -Wall -std=c99 test.c && ./a.out > > > 1 > > gcc should be throwing an uninitialised warning here. > > With the right warns it does :-) > > cc -Wall -std=c99 -O -Wuninitialized test.c > test.c > test.c: In function `main': > test.c:7: warning: 'i' might be used uninitialized in this function Grrr, I knew I should've read the man page. I guess you can't expect to get _all_ warnings when specifying -Wall *sigh* % cc -std=c99 -O -pedantic -Wall -Wshadow -Wuninitialized test.c test.c: In function `main': test.c:8: warning: declaration of 'i' shadows a previous local test.c:7: warning: shadowed declaration is here test.c:7: warning: 'i' might be used uninitialized in this function Ulrich Spoerlein -- 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?