[Gambas-devel] Compiling gambas using clang-analyzer

Adrien Prokopowicz adrien.prokopowicz at ...176...
Tue Aug 14 23:14:10 CEST 2012


Le mardi 14 août 2012 16:04:10 Sebastian Kulesz a écrit :
> On Tue, Aug 14, 2012 at 3:59 PM, Jussi Lahtinen
> 
> <jussi.lahtinen at ...176...> wrote:
> > Yes, I know (unless assertion is from some heavy function, then it is way
> > to optimize).
> > It was too early excitement about working code analyzer (my experiences
> > are
> > not very good).
> > 
> > Jussi
> > 
> > 
> > 
> > 
> > On 14 August 2012 21:56, Benoît Minisini <gambas at ...1...>
> > 
> > wrote:
> >> Le 14/08/2012 20:43, Jussi Lahtinen a écrit :
> >> >     File: main/gbc/gbc_read.c
> >> >     
> >> >     Line: 481, 544, 575
> >> >     Code: car = next_char();
> >> >     Message: Value stored to 'car' is never read
> >> > 
> >> > With quick look, at least these seems to be valid... Nice find!
> >> > 
> >> > Jussi
> >> 
> >> The "is never read" warnings are actually not important and can be
> >> safely ignored.
> >> 
> >> I a more interested in "Dereference of null pointer" errors!
> >> 
> >> --
> >> Benoît Minisini
> >> 
> >> 
> >> -------------------------------------------------------------------------
> >> ----- Live Security Virtual Conference
> >> Exclusive live event will cover all the ways today's security and
> >> threat landscape has changed and how IT managers can respond. Discussions
> >> will include endpoint security, mobile security and the latest in malware
> >> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> >> _______________________________________________
> >> Gambas-devel mailing list
> >> Gambas-devel at lists.sourceforge.net
> >> https://lists.sourceforge.net/lists/listinfo/gambas-devel
> > 
> > --------------------------------------------------------------------------
> > ---- Live Security Virtual Conference
> > Exclusive live event will cover all the ways today's security and
> > threat landscape has changed and how IT managers can respond. Discussions
> > will include endpoint security, mobile security and the latest in malware
> > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> > _______________________________________________
> > Gambas-devel mailing list
> > Gambas-devel at lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/gambas-devel
> 
> Here are some components that have "Dereference of null pointer" errors
> 
> gb.xml -> This one has a different error: Undefined allocation of 0
> bytes (CERT MEM04-C; CWE-131)
> gb.gtk
> gb.qt4

Hi,
The 4 errors in gb.xml seems to be false positives. The analyzer points out 
that 0 can be passed at memory allocation size. The warning would be valid for 
malloc, but not for realloc (used here) : if 0 is passed to realloc(), the 
memory is freed, and a NULL pointer is returned. This behaviour is intended.

But this tool can be useful, I'll keep it in mind. :-)

Regards,
Adrien.





More information about the Devel mailing list