Re: Fun with Squid2 and Clang
Hm. I'm trying 3.HEAD now, but it's giving me some trouble; analysis starts up fine, but when it gets to doing cf_gen_defines, it switches over to using g++ and doesn't switch back; see below. cf_gen didn't cause any problems for squid2; is there something new and weird in the build process here? Users/mnot/Downloads/checker-0.218/libexec/ccc-analyzer - DSQUID_SNMP=1 -I.. -I../include -I../include -Werror -Wall - Wpointer-arith -Wwrite-strings -Wmissing-prototypes -Wmissing- declarations -Wcomments -D_REENTRANT -Wall -g -O2 -MT snmp_pdu.o -MD - MP -MF .deps/snmp_pdu.Tpo -c -o snmp_pdu.o snmp_pdu.c ANALYZE: snmp_pdu.c snmp_pdu_create ANALYZE: snmp_pdu.c snmp_pdu_clone ANALYZE: snmp_pdu.c snmp_pdu_fix ANALYZE: snmp_pdu.c snmp_fix_pdu ANALYZE: snmp_pdu.c snmp_pdu_free ANALYZE: snmp_pdu.c snmp_free_pdu ANALYZE: snmp_pdu.c snmp_pdu_encode ANALYZE: snmp_pdu.c snmp_pdu_decode ANALYZE: snmp_pdu.c snmp_add_null_var mv -f .deps/snmp_pdu.Tpo .deps/snmp_pdu.Po /Users/mnot/Downloads/checker-0.218/libexec/ccc-analyzer - DSQUID_SNMP=1 -I.. -I../include -I../include -Werror -Wall - Wpointer-arith -Wwrite-strings -Wmissing-prototypes -Wmissing- declarations -Wcomments -D_REENTRANT -Wall -g -O2 -MT snmplib_debug.o - MD -MP -MF .deps/snmplib_debug.Tpo -c -o snmplib_debug.o snmplib_debug.c ANALYZE: snmplib_debug.c snmplib_debug mv -f .deps/snmplib_debug.Tpo .deps/snmplib_debug.Po rm -f libsnmp.a /usr/bin/ar cru libsnmp.a asn1.o parse.o snmp_vars.o coexistance.o snmp_api.o snmp_error.o mib.o snmp_api_error.o snmp_msg.o snmp_pdu.o snmplib_debug.o ranlib libsnmp.a Making all in scripts make[1]: Nothing to be done for `all'. Making all in src gawk -f ./cf_gen_defines ./cf.data.pre cf_gen_defines.h sed \ s...@default_http_port@%3128%g;\ s...@default_icp_port@%3130%g;\ s...@default_cache_effective_user@%nobody%g;\ s...@default_mime_table@%/opt/squid3-test/etc/mime.conf%g;\ s...@default_dnsserver@%/opt/squid3-test/libexec/`echo dnsserver | sed 's,x,x,;s/$//'`%g;\ s...@default_unlinkd@%/opt/squid3-test/libexec/`echo unlinkd | sed 's,x,x,;s/$//'`%g;\ s...@default_pinger@%/opt/squid3-test/libexec/`echo pinger | sed 's,x,x,;s/$//'`%g;\ s...@default_diskd@%/opt/squid3-test/libexec/`echo diskd | sed 's,x,x,;s/$//'`%g;\ s...@default_cache_log@%/opt/squid3-test/var/logs/cache.log%g;\ s...@default_access_log@%/opt/squid3-test/var/logs/access.log%g;\ s...@default_store_log@%/opt/squid3-test/var/logs/store.log%g;\ s...@default_pid_file@%/opt/squid3-test/var/squid.pid%g;\ s...@default_netdb_file@%/opt/squid3-test/var/logs/netdb.state%g;\ s...@default_swap_dir@%/opt/squid3-test/var/cache%g;\ s...@default_icon_dir@%/opt/squid3-test/share/icons%g;\ s...@default_mib_path@%/opt/squid3-test/share/mib.txt%g;\ s...@default_error_dir@%/opt/squid3-test/share/errors%g;\ s...@default_config_dir@%/opt/squid3-test/etc%g;\ s...@default_prefix@%/opt/squid3-test%g;\ s...@default_hosts@%/etc/hosts%g;\ s...@[v]ersion@%3.HEAD-20090902%g;\ ./cf.data.pre cf.data depbase=`echo cf_gen.o | sed 's|[^/]*$|.deps/|;s|\.o$||'`;\ g++ -DHAVE_CONFIG_H -DDEFAULT_CONFIG_FILE=\/opt/squid3-test/etc/ squid.conf\ -DDEFAULT_SQUID_DATA_DIR=\/opt/squid3-test/share\ - DDEFAULT_SQUID_CONFIG_DIR=\/opt/squid3-test/etc\ -I.. -I../include - I../src -I../include -I../lib -I../src -I/usr/include/libxml2 - Werror -Wall -Wpointer-arith -Wwrite-strings -Wcomments -D_REENTRANT - g -O2 -MT cf_gen.o -MD -MP -MF $depbase.Tpo -c -o cf_gen.o cf_gen.cc \ mv -f $depbase.Tpo $depbase.Po /bin/sh ../libtool --tag=CXX --mode=link g++ -I/usr/include/libxml2 - Werror -Wall -Wpointer-arith -Wwrite-strings -Wcomments -D_REENTRANT - g -O2 -g -o cf_gen cf_gen.o -L../lib -lmiscutil ../compat/ libcompat.la -lexpat -lxml2 -lm -lresolv mkdir .libs g++ -I/usr/include/libxml2 -Werror -Wall -Wpointer-arith -Wwrite- strings -Wcomments -D_REENTRANT -g -O2 -g -o cf_gen cf_gen.o -Wl,- bind_at_load -L/Users/mnot/Downloads/squid-3.HEAD-20090902/lib - lmiscutil ../compat/.libs/libcompat.a -lexpat -lxml2 -lm -lresolv ./cf_gen cf.data ./cf.data.depend gawk -f ./mk-string-arrays.awk ./err_type.h err_type.cc gawk -f ./mk-globals-c.awk ./globals.h globals.cc gawk -f ./mk-string-arrays.awk ./hier_code.h hier_code.cc gawk -f ./mk-string-arrays.awk ./icp_opcode.h icp_opcode.cc gawk -f ./mk-string-arrays.awk ./lookup_t.h lookup_t.cc /bin/sh ./repl_modules.sh lru repl_modules.cc gawk -f ./mk-string-arrays.awk ./swap_log_op.h swap_log_op.cc make all-recursive Making all in base /bin/sh ../../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H - I../.. -I../../include -I../../src -I../../include-I/usr/include/ libxml2 -Werror -Wall -Wpointer-arith -Wwrite-strings -Wcomments - D_REENTRANT -g -O2 -MT AsyncCall.lo -MD -MP -MF .deps/AsyncCall.Tpo -c -o AsyncCall.lo AsyncCall.cc g++
Re: Fun with Squid2 and Clang
Maybe that it's C++ while the others are C? Hmm.. from Clang homepage The Clang Static Analyzer consists of both a source code analysis framework and a standalone tool that finds bugs in C and Objective-C programs.. C++ is not C or Objective-C, so it's not too strange it doesn't work for C++ programs. And some seconds further digging gives http://clang.llvm.org/cxx_status.html Regards Henrik ons 2009-09-02 klockan 19:17 +1000 skrev Mark Nottingham: Hm. I'm trying 3.HEAD now, but it's giving me some trouble; analysis starts up fine, but when it gets to doing cf_gen_defines, it switches over to using g++ and doesn't switch back; see below. cf_gen didn't cause any problems for squid2; is there something new and weird in the build process here? Users/mnot/Downloads/checker-0.218/libexec/ccc-analyzer - DSQUID_SNMP=1 -I.. -I../include -I../include -Werror -Wall - Wpointer-arith -Wwrite-strings -Wmissing-prototypes -Wmissing- declarations -Wcomments -D_REENTRANT -Wall -g -O2 -MT snmp_pdu.o -MD - MP -MF .deps/snmp_pdu.Tpo -c -o snmp_pdu.o snmp_pdu.c ANALYZE: snmp_pdu.c snmp_pdu_create ANALYZE: snmp_pdu.c snmp_pdu_clone ANALYZE: snmp_pdu.c snmp_pdu_fix ANALYZE: snmp_pdu.c snmp_fix_pdu ANALYZE: snmp_pdu.c snmp_pdu_free ANALYZE: snmp_pdu.c snmp_free_pdu ANALYZE: snmp_pdu.c snmp_pdu_encode ANALYZE: snmp_pdu.c snmp_pdu_decode ANALYZE: snmp_pdu.c snmp_add_null_var mv -f .deps/snmp_pdu.Tpo .deps/snmp_pdu.Po /Users/mnot/Downloads/checker-0.218/libexec/ccc-analyzer - DSQUID_SNMP=1 -I.. -I../include -I../include -Werror -Wall - Wpointer-arith -Wwrite-strings -Wmissing-prototypes -Wmissing- declarations -Wcomments -D_REENTRANT -Wall -g -O2 -MT snmplib_debug.o - MD -MP -MF .deps/snmplib_debug.Tpo -c -o snmplib_debug.o snmplib_debug.c ANALYZE: snmplib_debug.c snmplib_debug mv -f .deps/snmplib_debug.Tpo .deps/snmplib_debug.Po rm -f libsnmp.a /usr/bin/ar cru libsnmp.a asn1.o parse.o snmp_vars.o coexistance.o snmp_api.o snmp_error.o mib.o snmp_api_error.o snmp_msg.o snmp_pdu.o snmplib_debug.o ranlib libsnmp.a Making all in scripts make[1]: Nothing to be done for `all'. Making all in src gawk -f ./cf_gen_defines ./cf.data.pre cf_gen_defines.h sed \ s...@default_http_port@%3128%g;\ s...@default_icp_port@%3130%g;\ s...@default_cache_effective_user@%nobody%g;\ s...@default_mime_table@%/opt/squid3-test/etc/mime.conf%g;\ s...@default_dnsserver@%/opt/squid3-test/libexec/`echo dnsserver | sed 's,x,x,;s/$//'`%g;\ s...@default_unlinkd@%/opt/squid3-test/libexec/`echo unlinkd | sed 's,x,x,;s/$//'`%g;\ s...@default_pinger@%/opt/squid3-test/libexec/`echo pinger | sed 's,x,x,;s/$//'`%g;\ s...@default_diskd@%/opt/squid3-test/libexec/`echo diskd | sed 's,x,x,;s/$//'`%g;\ s...@default_cache_log@%/opt/squid3-test/var/logs/cache.log%g;\ s...@default_access_log@%/opt/squid3-test/var/logs/access.log%g;\ s...@default_store_log@%/opt/squid3-test/var/logs/store.log%g;\ s...@default_pid_file@%/opt/squid3-test/var/squid.pid%g;\ s...@default_netdb_file@%/opt/squid3-test/var/logs/netdb.state%g;\ s...@default_swap_dir@%/opt/squid3-test/var/cache%g;\ s...@default_icon_dir@%/opt/squid3-test/share/icons%g;\ s...@default_mib_path@%/opt/squid3-test/share/mib.txt%g;\ s...@default_error_dir@%/opt/squid3-test/share/errors%g;\ s...@default_config_dir@%/opt/squid3-test/etc%g;\ s...@default_prefix@%/opt/squid3-test%g;\ s...@default_hosts@%/etc/hosts%g;\ s...@[v]ersion@%3.HEAD-20090902%g;\ ./cf.data.pre cf.data depbase=`echo cf_gen.o | sed 's|[^/]*$|.deps/|;s|\.o$||'`;\ g++ -DHAVE_CONFIG_H -DDEFAULT_CONFIG_FILE=\/opt/squid3-test/etc/ squid.conf\ -DDEFAULT_SQUID_DATA_DIR=\/opt/squid3-test/share\ - DDEFAULT_SQUID_CONFIG_DIR=\/opt/squid3-test/etc\ -I.. -I../include - I../src -I../include -I../lib -I../src -I/usr/include/libxml2 - Werror -Wall -Wpointer-arith -Wwrite-strings -Wcomments -D_REENTRANT - g -O2 -MT cf_gen.o -MD -MP -MF $depbase.Tpo -c -o cf_gen.o cf_gen.cc \ mv -f $depbase.Tpo $depbase.Po /bin/sh ../libtool --tag=CXX --mode=link g++ -I/usr/include/libxml2 - Werror -Wall -Wpointer-arith -Wwrite-strings -Wcomments -D_REENTRANT - g -O2 -g -o cf_gen cf_gen.o -L../lib -lmiscutil ../compat/ libcompat.la -lexpat -lxml2 -lm -lresolv mkdir .libs g++ -I/usr/include/libxml2 -Werror -Wall -Wpointer-arith -Wwrite- strings -Wcomments -D_REENTRANT -g -O2 -g -o cf_gen cf_gen.o -Wl,- bind_at_load -L/Users/mnot/Downloads/squid-3.HEAD-20090902/lib - lmiscutil ../compat/.libs/libcompat.a -lexpat -lxml2 -lm -lresolv ./cf_gen cf.data ./cf.data.depend gawk -f ./mk-string-arrays.awk ./err_type.h err_type.cc gawk -f ./mk-globals-c.awk ./globals.h globals.cc gawk -f ./mk-string-arrays.awk ./hier_code.h hier_code.cc gawk -f ./mk-string-arrays.awk
Fun with Squid2 and Clang
Seeing the fun new tools in Snow Leopard's XCode, I dug a bit and ran Clang's static analyser http://clang-analyzer.llvm.org/ on squid2- HEAD; see http://www.mnot.net/test/squid-scan/ for results. If this is interesting/useful, I can do a quick run on squid3 as well; it's pretty easy. Cheers, -- Mark Nottingham m...@yahoo-inc.com
Re: Fun with Squid2 and Clang
On Wed, Sep 2, 2009 at 4:23 AM, Mark Nottinghamm...@yahoo-inc.com wrote: Seeing the fun new tools in Snow Leopard's XCode, I dug a bit and ran Clang's static analyser http://clang-analyzer.llvm.org/ on squid2-HEAD; see http://www.mnot.net/test/squid-scan/ for results. If this is interesting/useful, I can do a quick run on squid3 as well; it's pretty easy. Please, do it if it's not too much work. 3.0, 3.1 and HEAD would be interesting. -- /kinkie