On Wed, Feb 05, 2020 at 09:59:19AM -0500, David Malcolm wrote:
> Although the analyzer works on GIMPLE SSA and therefore in theory ought
> to support all languages supported by GCC, the code currently only
> supports the subset of GIMPLE SSA expressible via the C frontend.
> 
> For GCC 10 I want to explicitly restrict the scope of the analyzer to
> C code, to keep the initial scope of the feature sane.
> 
> For example, various C++ things aren't yet supported by the analyzer and
> won't be in GCC 10 (exceptions, new/delete diagnostics, ctors that run
> before main, etc)

C has ctors before main too, look for attribute constructor.

I must say I don't really like this, if you encounter something in the IL
that the analyzer can't handle yet, punt, that is fine, but you could
write code in C++ that doesn't use exceptions nor new/delete, there is
no reason not to analyze that, etc.  And teaching it to handle new/delete
operator like malloc/free shouldn't be that hard, but even if you don't,
you still need some way how to deal with other allocators in C, say for
stuff allocated with mmap etc.

Mentioning in the documentation that it is for now primarily intended for C
is one thing (that is fine), but stopping analyzing something is another.

        Jakub

Reply via email to