This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Patch for various warnings in gcc
- From: Gabriel Dos Reis <gdr at integrable-solutions dot net>
- To: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- Cc: dave at hiauly1 dot hia dot nrc dot ca, dave dot anglin at nrc dot ca, gcc-patches at gcc dot gnu dot org, matz at suse dot de
- Date: 08 Aug 2002 20:02:40 +0200
- Subject: Re: Patch for various warnings in gcc
- Organization: CodeSourcery, LLC
- References: <200208081557.g78FvRoR015851@hiauly1.hia.nrc.ca> <200208081753.NAA12312@caip.rutgers.edu>
"Kaveh R. Ghazi" <ghazi@caip.rutgers.edu> writes:
| > From: "John David Anglin" <dave@hiauly1.hia.nrc.ca>
| >
| > > int main()
| > > {
| > > int a = a;
| > >
| > > return a;
| > > }
| >
| > I tried it under HP cc (hpux10.20) and VAX Ultrix pcc, with and without "-O".
| > All compile without error and execute returning a status of 0, except
| > for HP cc at -O:
| >
| > 507 (hiauly1)dave> cc -o self -O self.c
| > cc: line 5: warning 5004: Uninitialized variable "a" in function "main" (5004)
|
| But it still compiled right?
|
| I tried cc on irix6.2 and solaris2 and it worked.
I'm not sure how I should interpret "it worked". The above construct
strictly speaking invokes an undefined behaviour. So in the least
damaging mode, it might return any random value.
-- Gaby