Re: Static source code analysis of crystalspace

Matthieu Kraus <[email protected]> Tue, 25 Feb 2014 16:59:05 +0100
Newsgroups gmane.comp.graphics.crystalspace.devel
Message-ID <[email protected]>
I don't have the time to check all by hand right now, but a quick  
check on random ones seems to yield the same so far: it complains  
about pointers being processed while potentially being null for  
functions that assert that pointer mustn't be null. Basically various  
sanity checks (e.g. out-of-bounds for arrays, null for a vast majority  
of pointer containers like strings, ...) are only performed in debug  
mode using asserts and shouldn't occur in production code as they're  
input errors.
Besides that there's the sizeof mismatch caused by a pointer being  
reinterpreted to a different pointer type which would break if the  
size of different pointer types was different which is nothing to  
really worry about, either (hint: this is only true for very exotic  
setups which wouldn't run CS for various other reasons, anyway).

Zitat von John Smith <[email protected]>:

> Hi,
>
>
> Thank you very much for taking the time to clarify that for me; that
> explains all the 'analyzer failures'. Ill look up the report in the
> clang/llvm bug tracker. Thanks.
>
> But what about the 'reports' ?
>
>
> Regards,
>
>
> John Smith
>
>
>
> On Tue, Feb 25, 2014 at 4:10 PM, Matthieu Kraus
> <[email protected]> wrote:
>> It's actually not an issue with gcc (or VS) being more permissive, but
>> with clang rejecting standard code.
>> I already had a look at those specific pieces of code when I was
>> re-visiting CS on FreeBSD last year (as FreeBSD moved to clang as core
>> compiler). The problem there is related to template classes and
>> friends which fail in clang due to clang lacking support for proper
>> friend relationships (there's also a bug on the clang/llvm tracker
>> about it as the way friend is currently implemented in clang is more a
>> hack than a proper implementation).
>>
>> Kind regards,
>> RlyDontKnow
>>
>> Zitat von John Smith <[email protected]>:
>>
>>> Hi,
>>>
>>> Just for fun, I ran the llvm/clang static source code analyzer on
>>> (parts of) the (svn trunk /head) crystalspace code.
>>>
>>> What stood out most to me in the results are not just the regular
>>> reports, but the items listed at the bottom in the 'analyzer failures'
>>> section. All of these items (besides the very first one listed, which
>>> is an actual analyzer crash) are instances were the clang compiler
>>> failed to correctly parse the code. I guess gcc is being more
>>> permissive here.
>>>
>>> Anyway, the full results can be found here:
>>> http://lbalbalba.url.ph/clang/cs/
>>>
>>>
>>>
>>> Regards,
>>>
>>>
>>> John Smith
>>>
>>> ------------------------------------------------------------------------------
>>> Flow-based real-time traffic analytics software. Cisco certified tool.
>>> Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer
>>> Customize your own dashboards, set traffic alerts and generate reports.
>>> Network behavioral analysis & security monitoring. All-in-one tool.
>>> http://pubads.g.doubleclick.net/gampad/clk?id=126839071&iu=/4140/ostg.clktrk
>>> _______________________________________________
>>> Crystal-develop mailing list
>>> [email protected]
>>> https://lists.sourceforge.net/lists/listinfo/crystal-develop
>>
>>
>>
>>
>> ------------------------------------------------------------------------------
>> Flow-based real-time traffic analytics software. Cisco certified tool.
>> Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer
>> Customize your own dashboards, set traffic alerts and generate reports.
>> Network behavioral analysis & security monitoring. All-in-one tool.
>> http://pubads.g.doubleclick.net/gampad/clk?id=126839071&iu=/4140/ostg.clktrk
>> _______________________________________________
>> Crystal-develop mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/crystal-develop
>
> ------------------------------------------------------------------------------
> Flow-based real-time traffic analytics software. Cisco certified tool.
> Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer
> Customize your own dashboards, set traffic alerts and generate reports.
> Network behavioral analysis & security monitoring. All-in-one tool.
> http://pubads.g.doubleclick.net/gampad/clk?id=126839071&iu=/4140/ostg.clktrk
> _______________________________________________
> Crystal-develop mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/crystal-develop




------------------------------------------------------------------------------
Flow-based real-time traffic analytics software. Cisco certified tool.
Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer
Customize your own dashboards, set traffic alerts and generate reports.
Network behavioral analysis & security monitoring. All-in-one tool.
http://pubads.g.doubleclick.net/gampad/clk?id=126839071&iu=/4140/ostg.clktrk