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: warning: '<some_var>' may be used uninitialized in this function


The chain of inferences that the compiler would need to do to properly
diagnose this case is beyond the scope of the mechanical transformations.
The reasoning you need to implement to catch these cases could even be
reduced to the halting problem.

I hate to bring this up, because it's a "half-troll", but the halting problem is *not* undecidable on the machines we use everyday, because they have finite memory.


The halting problem *is* solvable for finite machines (and indeed, if it wasn't, we'd be in serious trouble).
http://doi.acm.org/10.1145/1052796.1052798



It's one thing to say it's beyond of the scope of the mechanical transformations we want to do, but reduction to the halting problem is usually just a punt :)




The uninitialized warnings are fairly easy to trick. There is only so much the compiler can realistically do.



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