On Fri, 15 Aug 2008, Mike Kershaw wrote:
> On Fri, Aug 15, 2008 at 10:53:04AM -0400, lex wrote:
>> When you get this msg from a compile, you still have to find out which
>> uses of the variable are the offending entries. If I have 45 uses of x,
>> how do I find out which ones are causing the msg?
>
> The first one.
>
> All these warnings are of the type:
>
> int x;
>
> if (x == 1) { }
>
> so a more complex version:
>
> int x;
>
> if (x == 1) { } // Uninitialized
>
> if (x == 2) { } // Uninitialized
>
> x = 3; // We've set it
>
> if (x == 4) { } // initialized, the compiler knows we set this.
>
>> The compiler knows, but it keeps that information to itself.
>
> It should print the line number of the first use, otherwise, the first
> time you use that variable will be the unit use (and subsequent reads).
>
>> I now have found a way to identify them with a program (without my
>> writing a dataflow analysis), but before I write it, if anyone already has
>> such a program, please tell me now so I don't do any unnecessary work.
>
> Not sure I understand the question I guess. I've never had a problem
> identifying the location of the compiler warning (though sometimes the
> reason behind it generating a warning is more obscure)
>
> -m
>
> --
> Mike Kershaw/Dragorn <[EMAIL PROTECTED]>
No, the first (and only) msg has the line number of where the variable is
DEFINED, not used.
What I want to know is which USEs are the offending ones.
Lex
_______________________________________________
Mid-Hudson Valley Linux Users Group http://mhvlug.org
http://mhvlug.org/cgi-bin/mailman/listinfo/mhvlug
Upcoming Meetings (6pm - 8pm) MHVLS Auditorium
Jun 4 - Sqeak! and eToys
Jul 2 - KVM (Tenative)
Aug 6 - Zenos
Sep 3 - TBD