This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: missed uninitialised variable warning
- From: Alexandre Oliva <aoliva at redhat dot com>
- To: dewar at gnat dot com (Robert Dewar)
- Cc: guerby at acm dot org, akpm at osdl dot org, gcc at gcc dot gnu dot org, gdr at integrable-solutions dot net, matz at suse dot de, pinskia at physics dot uc dot edu
- Date: 04 Aug 2003 15:14:32 -0300
- Subject: Re: missed uninitialised variable warning
- Organization: GCC Team, Red Hat
- References: <20030804180850.8095AF2D7C@nile.gnat.com>
On Aug 4, 2003, dewar@gnat.com (Robert Dewar) wrote:
>> In C and C++ it's legal, and there are actual cases in which you do
>> want to reference the variable (as an lvalue) before its declaration
>> is complete.
> Isn't that a bit dubious from a formal point of view.
I don't see why, and I've already given the example:
void *x = &x;
This must work, and I don't see anything possibly dubious about it.
--
Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer aoliva@{redhat.com, gcc.gnu.org}
CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist Professional serial bug killer