This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Super Lint (was: Unexecutable Stack / Buffer Overflow Exploits...)
- To: oxymoron at waste dot org (Oliver Xymoron)
- Subject: Re: Super Lint (was: Unexecutable Stack / Buffer Overflow Exploits...)
- From: Joe Buck <jbuck at synopsys dot COM>
- Date: Tue, 4 Jan 0 9:39:39 PST
- Cc: dalecki at cs dot net dot pl, ebiederm+eric at ccr dot net, kaih at khms dot westfalen dot de, linux-kernel at vger dot rutgers dot edu, tytso at mit dot edu, gcc at gcc dot gnu dot org
Undecidability simply means that any correct program that attempts to
do certain kinds of analysis must return a three-valued answer: yes,
no, or "I can't tell". gcc is already full of code that attempts to
solve undecidable problems: warning about code that will never be
reached, or warning about using variables before they are initialized,
is one obvious example:
CODE;
STATEMENT;
STATEMENT is reached iff CODE halts, so we must solve the halting problem
to tell, in general, which statements can be reached. If STATEMENT uses a
variable that is not set, then we can't write a perfect -Winitialized
without solving the halting problem.
Yet we have a useful -Winitialized anyway; it warns in the "I can't tell"
cases as well as in the "yes" cases.