> That is not at all what I wanted. The compiler does not identify
> all potential problems, only things that it knows for sure are problems.
> That seems pretty worthless! Why isn't there an option that flags ALL
> potential problems?
>
> I can imagine that the reason there isn't is because, as you say, it is a
> harder problem, and the gcc writers don't want to get involved.
> That is what the microsoft C++ team said in a faq page when someone asked
> why their compiler didn't find all of the interesting information.

Yes. And Microsoft, IBM, and other big companies, as well as open source
projects, are tackling this problem in other ways. The static analysis
tools I pointed you to gives you an idea of what's going on.

> So, it looks like I have to deal with the fact that variables are
> initialized or uninitialized in the generator, and I cannot
> rely on the compiler for accurate information.

The compiler's primary job is to turn correct programs into correct
machine code. A secondary job is to warn the user when the program might
not behave like the user expects it to (i.e. uninitialized variables,
etc), but this is not a primary function. If you read the C/C++ standards
you will find that it doesn't require compilers to issue uninitialized
variable diagnostics at all.

The open source gcc compiler's progress seems to reflect the fact that
most people are more interested in fast code generation, correct
compilation, high levels of optimization, standards conformance, and
useful extensions over better warnings. The tides are changing slowly -
more warnings have been added in the recent years - but I don't expect
miracles in that area in gcc any time soon.

-Frank

--
----------------------------------
Frank Wallingford
[EMAIL PROTECTED]


_______________________________________________
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

Reply via email to