From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from az33egw02.freescale.net (az33egw02.freescale.net [192.88.158.103]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "az33egw02.freescale.net", Issuer "Thawte Premium Server CA" (verified OK)) by ozlabs.org (Postfix) with ESMTPS id AA825DDFAC for ; Sat, 11 Apr 2009 04:44:31 +1000 (EST) Message-ID: <49DF933F.7030101@freescale.com> Date: Fri, 10 Apr 2009 13:43:11 -0500 From: Scott Wood MIME-Version: 1.0 To: Andreas Schwab Subject: Re: [PATCH] Quieten arch/powerpc in a allmodconfig build. References: <2c4bcf8d1d7083ff53ce5b556765e96676a007fb.1239165378.git.tony@bakeyournoodle.com> <1239167335.10104.26.camel@localhost> <20090408055126.GG16602@bilbo.ozlabs.org> <7ED93BB3-FE0E-4102-89FB-78950A533717@kernel.crashing.org> <20090409224553.GO16602@bilbo.ozlabs.org> <20090410091149.5068d8e1.sfr@canb.auug.org.au> <1AAD5906-66FA-4850-8C62-8C030816E44E@kernel.crashing.org> <49DF89F7.2070403@freescale.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Cc: Stephen Rothwell , linuxppc-dev@ozlabs.org List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Andreas Schwab wrote: > Scott Wood writes: > >> The problem is that GCC does not give an error (only a warning) even for >> things like this where it should be trivial to detect that the usage *is* >> uninitialized, not just might be: >> >> int foo(void) >> { >> int a; >> >> return a; >> } > > The compiler must not reject this code, because the undefined behavior > only occurs if executed. There is no constraint violated. Fine (though GCC could have something similar to -Werror but more limited in scope to the really serious stuff that *should* be illegal even if it isn't), but it should at least be a separate warning class. My point was to counter Segher's assertion that the compiler currently gives an error on the obvious stuff. -Scott