This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: missed uninitialised variable warning


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]