You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Igor Galić <i....@brainsware.org> on 2012/09/14 20:10:17 UTC

Clang Checkers

Hey folks,

over at trafficserver we started looking into running
clang's checkers over our code. Using the momentum, Daniel
and myself rand the checkers over httpd and apr (both from
trunk) as well.

Daniel's checks are ran under FreeBSD/clang 3.0:

   http://inhouse.humbedooh.com/clang/2012-09-14-3/

Mine are ran under Fedora and clang 3.2 (trunk):

   http://people.apache.org/~igalic/checks/httpd/latest/


So long,

i

-- 
Igor Galić

Tel: +43 (0) 664 886 22 883
Mail: i.galic@brainsware.org
URL: http://brainsware.org/
GPG: 6880 4155 74BD FD7C B515  2EA5 4B1D 9E08 A097 C9AE


Re: Clang Checkers

Posted by Christophe JAILLET <ch...@wanadoo.fr>.
Hi,

this one remove a dead assignment and reduce the scope of a variable.

  mod_proxy_balancer.c |    3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)

Best regards,
CJ


On 09/14/2012 08:10 PM, Igor Galić wrote:
>
> Hey folks,
>
> over at trafficserver we started looking into running
> clang's checkers over our code. Using the momentum, Daniel
> and myself rand the checkers over httpd and apr (both from
> trunk) as well.
>
> Daniel's checks are ran under FreeBSD/clang 3.0:
>
>     http://inhouse.humbedooh.com/clang/2012-09-14-3/
>
> Mine are ran under Fedora and clang 3.2 (trunk):
>
>     http://people.apache.org/~igalic/checks/httpd/latest/
>
>
> So long,
>
> i
>


Re: Clang Checkers

Posted by Christophe JAILLET <ch...@wanadoo.fr>.
Hi,

here are 2 obvious fixes against apr.

  apr/strings/apr_snprintf.c |    1 -
  apr/xml/apr_xml.c          |    2 +-
  2 files changed, 1 insertion(+), 2 deletions(-)


Best regards,
CJ


On 09/14/2012 08:10 PM, Igor Galić wrote:
>
> Hey folks,
>
> over at trafficserver we started looking into running
> clang's checkers over our code. Using the momentum, Daniel
> and myself rand the checkers over httpd and apr (both from
> trunk) as well.
>
> Daniel's checks are ran under FreeBSD/clang 3.0:
>
>     http://inhouse.humbedooh.com/clang/2012-09-14-3/
>
> Mine are ran under Fedora and clang 3.2 (trunk):
>
>     http://people.apache.org/~igalic/checks/httpd/latest/
>
>
> So long,
>
> i
>


Re: Clang Checkers

Posted by Christophe JAILLET <ch...@wanadoo.fr>.
Hi,

here is an old response that got lost in my mail client... As we say in 
France, better late than never...


 >>>>>>>>

report for dead assignment in modules/proxy/mod_proxy_ftp.c is interesting.

IMO, either there is a real bug there or the code need to be cleaned up 
because some part of it can never trigger.


In the huge function' proxy_send_dir_filter', there is a 'if' block 
between line 678 and line 727.
In this block 2 variables, searchidx and firstfile, are declared and used.

However, being variable local to the if block, they are initialized 
*every* time we reach line 681.
So :

     - firstfile:
         - line 681: initialized to 1
         - line 704: test is always true, first block is always executed

     - searchidx:
         - useless because of the above.

I'm not sure of what the logic should be, but there seems be be 
something broken here.


BTW, if you could re-run clang and post the result, it could be interesting.


CJ

Le 14/09/2012 20:10, Igor Galić a écrit :
> Hey folks,
>
> over at trafficserver we started looking into running
> clang's checkers over our code. Using the momentum, Daniel
> and myself rand the checkers over httpd and apr (both from
> trunk) as well.
>
> Daniel's checks are ran under FreeBSD/clang 3.0:
>
>     http://inhouse.humbedooh.com/clang/2012-09-14-3/
>
> Mine are ran under Fedora and clang 3.2 (trunk):
>
>     http://people.apache.org/~igalic/checks/httpd/latest/
>
>
> So long,
>
> i
>



Re: Clang Checkers

Posted by Christophe JAILLET <ch...@wanadoo.fr>.
Hi,

here is an old response that got lost in my mail client... As we say in 
France, better late than never...


 >>>>>>>>

report for dead assignment in modules/proxy/mod_proxy_ftp.c is interesting.

IMO, either there is a real bug there or the code need to be cleaned up 
because some part of it can never trigger.


In the huge function' proxy_send_dir_filter', there is a 'if' block 
between line 678 and line 727.
In this block 2 variables, searchidx and firstfile, are declared and used.

However, being variable local to the if block, they are initialized 
*every* time we reach line 681.
So :

     - firstfile:
         - line 681: initialized to 1
         - line 704: test is always true, first block is always executed

     - searchidx:
         - useless because of the above.

I'm not sure of what the logic should be, but there seems be be 
something broken here.


BTW, if you could re-run clang and post the result, it could be interesting.


CJ

Le 14/09/2012 20:10, Igor Galić a écrit :
> Hey folks,
>
> over at trafficserver we started looking into running
> clang's checkers over our code. Using the momentum, Daniel
> and myself rand the checkers over httpd and apr (both from
> trunk) as well.
>
> Daniel's checks are ran under FreeBSD/clang 3.0:
>
>     http://inhouse.humbedooh.com/clang/2012-09-14-3/
>
> Mine are ran under Fedora and clang 3.2 (trunk):
>
>     http://people.apache.org/~igalic/checks/httpd/latest/
>
>
> So long,
>
> i
>