This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: missed uninitialised variable warning
- From: Gabriel Dos Reis <gdr at integrable-solutions dot net>
- To: dewar at gnat dot com (Robert Dewar)
- Cc: aoliva at redhat dot com, guerby at acm dot org, akpm at osdl dot org, gcc at gcc dot gnu dot org, matz at suse dot de, pinskia at physics dot uc dot edu
- Date: 04 Aug 2003 20:14:42 +0200
- Subject: Re: missed uninitialised variable warning
- Organization: Integrable Solutions
- References: <20030804180850.8095AF2D7C@nile.gnat.com>
dewar@gnat.com (Robert Dewar) writes:
| > 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.
It may be dubious from Ada point of view. But it isn't necessary from C and
C++ point of view.
| Yes, I understand
| it will typically work, but I am not sure I can deduce that it must work.
unsigned char c = c;
is guaranted to work, just like
void* x = &x;
in C and C++.
-- Gaby