On Fri, Jun 29, 2012 at 6:02 AM, Pete Batard <p...@akeo.ie> wrote: > As promised. Hopefully this will silence the warnings raised by Clang on > OS-X. > > And again, if someone wants to look into silencing that -std=gnu99 one, > you're welcome to submit a patch. I'm not planning to look into it, but that > doesn't mean there won't be review+integration of a patch if one is > submitted. >
The patch reduced some warnings but there are still 3 warnings remained. Actually the three warnings are basically the same though. mymacmini:build xiaofanc$ ~/bin/scan-build -k -v -V make scan-build: Emitting reports for this run to '/var/folders/_k/njr5n6mj09924bn1rfxx3slh0000gn/T/scan-build-2012-06-30-2'. make all-recursive Making all in libusb /bin/sh ../libtool --tag=CC --mode=compile /Users/xiaofanc/bin/libexec/ccc-analyzer -DHAVE_CONFIG_H -I. -I../../libusbx/libusb -I.. -fvisibility=hidden -std=gnu99 -Wall -Wundef -Wunused -Wstrict-prototypes -Werror-implicit-function-declaration -Wno-pointer-sign -Wshadow -g -O2 -MT libusb_1_0_la-core.lo -MD -MP -MF .deps/libusb_1_0_la-core.Tpo -c -o libusb_1_0_la-core.lo `test -f 'core.c' || echo '../../libusbx/libusb/'`core.c libtool: compile: /Users/xiaofanc/bin/libexec/ccc-analyzer -DHAVE_CONFIG_H -I. -I../../libusbx/libusb -I.. -fvisibility=hidden -std=gnu99 -Wall -Wundef -Wunused -Wstrict-prototypes -Werror-implicit-function-declaration -Wno-pointer-sign -Wshadow -g -O2 -MT libusb_1_0_la-core.lo -MD -MP -MF .deps/libusb_1_0_la-core.Tpo -c ../../libusbx/libusb/core.c -fno-common -DPIC -o .libs/libusb_1_0_la-core.o libtool: compile: /Users/xiaofanc/bin/libexec/ccc-analyzer -DHAVE_CONFIG_H -I. -I../../libusbx/libusb -I.. -fvisibility=hidden -std=gnu99 -Wall -Wundef -Wunused -Wstrict-prototypes -Werror-implicit-function-declaration -Wno-pointer-sign -Wshadow -g -O2 -MT libusb_1_0_la-core.lo -MD -MP -MF .deps/libusb_1_0_la-core.Tpo -c ../../libusbx/libusb/core.c -o libusb_1_0_la-core.o >/dev/null 2>&1 mv -f .deps/libusb_1_0_la-core.Tpo .deps/libusb_1_0_la-core.Plo /bin/sh ../libtool --tag=CC --mode=compile /Users/xiaofanc/bin/libexec/ccc-analyzer -DHAVE_CONFIG_H -I. -I../../libusbx/libusb -I.. -fvisibility=hidden -std=gnu99 -Wall -Wundef -Wunused -Wstrict-prototypes -Werror-implicit-function-declaration -Wno-pointer-sign -Wshadow -g -O2 -MT libusb_1_0_la-descriptor.lo -MD -MP -MF .deps/libusb_1_0_la-descriptor.Tpo -c -o libusb_1_0_la-descriptor.lo `test -f 'descriptor.c' || echo '../../libusbx/libusb/'`descriptor.c libtool: compile: /Users/xiaofanc/bin/libexec/ccc-analyzer -DHAVE_CONFIG_H -I. -I../../libusbx/libusb -I.. -fvisibility=hidden -std=gnu99 -Wall -Wundef -Wunused -Wstrict-prototypes -Werror-implicit-function-declaration -Wno-pointer-sign -Wshadow -g -O2 -MT libusb_1_0_la-descriptor.lo -MD -MP -MF .deps/libusb_1_0_la-descriptor.Tpo -c ../../libusbx/libusb/descriptor.c -fno-common -DPIC -o .libs/libusb_1_0_la-descriptor.o libtool: compile: /Users/xiaofanc/bin/libexec/ccc-analyzer -DHAVE_CONFIG_H -I. -I../../libusbx/libusb -I.. -fvisibility=hidden -std=gnu99 -Wall -Wundef -Wunused -Wstrict-prototypes -Werror-implicit-function-declaration -Wno-pointer-sign -Wshadow -g -O2 -MT libusb_1_0_la-descriptor.lo -MD -MP -MF .deps/libusb_1_0_la-descriptor.Tpo -c ../../libusbx/libusb/descriptor.c -o libusb_1_0_la-descriptor.o >/dev/null 2>&1 mv -f .deps/libusb_1_0_la-descriptor.Tpo .deps/libusb_1_0_la-descriptor.Plo /bin/sh ../libtool --tag=CC --mode=compile /Users/xiaofanc/bin/libexec/ccc-analyzer -DHAVE_CONFIG_H -I. -I../../libusbx/libusb -I.. -fvisibility=hidden -std=gnu99 -Wall -Wundef -Wunused -Wstrict-prototypes -Werror-implicit-function-declaration -Wno-pointer-sign -Wshadow -g -O2 -MT libusb_1_0_la-io.lo -MD -MP -MF .deps/libusb_1_0_la-io.Tpo -c -o libusb_1_0_la-io.lo `test -f 'io.c' || echo '../../libusbx/libusb/'`io.c libtool: compile: /Users/xiaofanc/bin/libexec/ccc-analyzer -DHAVE_CONFIG_H -I. -I../../libusbx/libusb -I.. -fvisibility=hidden -std=gnu99 -Wall -Wundef -Wunused -Wstrict-prototypes -Werror-implicit-function-declaration -Wno-pointer-sign -Wshadow -g -O2 -MT libusb_1_0_la-io.lo -MD -MP -MF .deps/libusb_1_0_la-io.Tpo -c ../../libusbx/libusb/io.c -fno-common -DPIC -o .libs/libusb_1_0_la-io.o libtool: compile: /Users/xiaofanc/bin/libexec/ccc-analyzer -DHAVE_CONFIG_H -I. -I../../libusbx/libusb -I.. -fvisibility=hidden -std=gnu99 -Wall -Wundef -Wunused -Wstrict-prototypes -Werror-implicit-function-declaration -Wno-pointer-sign -Wshadow -g -O2 -MT libusb_1_0_la-io.lo -MD -MP -MF .deps/libusb_1_0_la-io.Tpo -c ../../libusbx/libusb/io.c -o libusb_1_0_la-io.o >/dev/null 2>&1 mv -f .deps/libusb_1_0_la-io.Tpo .deps/libusb_1_0_la-io.Plo /bin/sh ../libtool --tag=CC --mode=compile /Users/xiaofanc/bin/libexec/ccc-analyzer -DHAVE_CONFIG_H -I. -I../../libusbx/libusb -I.. -fvisibility=hidden -std=gnu99 -Wall -Wundef -Wunused -Wstrict-prototypes -Werror-implicit-function-declaration -Wno-pointer-sign -Wshadow -g -O2 -MT libusb_1_0_la-sync.lo -MD -MP -MF .deps/libusb_1_0_la-sync.Tpo -c -o libusb_1_0_la-sync.lo `test -f 'sync.c' || echo '../../libusbx/libusb/'`sync.c libtool: compile: /Users/xiaofanc/bin/libexec/ccc-analyzer -DHAVE_CONFIG_H -I. -I../../libusbx/libusb -I.. -fvisibility=hidden -std=gnu99 -Wall -Wundef -Wunused -Wstrict-prototypes -Werror-implicit-function-declaration -Wno-pointer-sign -Wshadow -g -O2 -MT libusb_1_0_la-sync.lo -MD -MP -MF .deps/libusb_1_0_la-sync.Tpo -c ../../libusbx/libusb/sync.c -fno-common -DPIC -o .libs/libusb_1_0_la-sync.o ../../libusbx/libusb/sync.c:84:28: warning: Result of 'malloc' is converted to a pointer of type 'unsigned char', which is incompatible with sizeof operand type 'struct libusb_control_setup' buffer = (unsigned char*) malloc(LIBUSB_CONTROL_SETUP_SIZE + wLength); ~~~~~~~~~~~~~~ ^~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~ 1 warning generated. libtool: compile: /Users/xiaofanc/bin/libexec/ccc-analyzer -DHAVE_CONFIG_H -I. -I../../libusbx/libusb -I.. -fvisibility=hidden -std=gnu99 -Wall -Wundef -Wunused -Wstrict-prototypes -Werror-implicit-function-declaration -Wno-pointer-sign -Wshadow -g -O2 -MT libusb_1_0_la-sync.lo -MD -MP -MF .deps/libusb_1_0_la-sync.Tpo -c ../../libusbx/libusb/sync.c -o libusb_1_0_la-sync.o >/dev/null 2>&1 mv -f .deps/libusb_1_0_la-sync.Tpo .deps/libusb_1_0_la-sync.Plo /bin/sh ../libtool --tag=CC --mode=compile /Users/xiaofanc/bin/libexec/ccc-analyzer -DHAVE_CONFIG_H -I. -I../../libusbx/libusb -I.. -fvisibility=hidden -std=gnu99 -Wall -Wundef -Wunused -Wstrict-prototypes -Werror-implicit-function-declaration -Wno-pointer-sign -Wshadow -g -O2 -MT libusb_1_0_la-darwin_usb.lo -MD -MP -MF .deps/libusb_1_0_la-darwin_usb.Tpo -c -o libusb_1_0_la-darwin_usb.lo `test -f 'os/darwin_usb.c' || echo '../../libusbx/libusb/'`os/darwin_usb.c libtool: compile: /Users/xiaofanc/bin/libexec/ccc-analyzer -DHAVE_CONFIG_H -I. -I../../libusbx/libusb -I.. -fvisibility=hidden -std=gnu99 -Wall -Wundef -Wunused -Wstrict-prototypes -Werror-implicit-function-declaration -Wno-pointer-sign -Wshadow -g -O2 -MT libusb_1_0_la-darwin_usb.lo -MD -MP -MF .deps/libusb_1_0_la-darwin_usb.Tpo -c ../../libusbx/libusb/os/darwin_usb.c -fno-common -DPIC -o .libs/libusb_1_0_la-darwin_usb.o libtool: compile: /Users/xiaofanc/bin/libexec/ccc-analyzer -DHAVE_CONFIG_H -I. -I../../libusbx/libusb -I.. -fvisibility=hidden -std=gnu99 -Wall -Wundef -Wunused -Wstrict-prototypes -Werror-implicit-function-declaration -Wno-pointer-sign -Wshadow -g -O2 -MT libusb_1_0_la-darwin_usb.lo -MD -MP -MF .deps/libusb_1_0_la-darwin_usb.Tpo -c ../../libusbx/libusb/os/darwin_usb.c -o libusb_1_0_la-darwin_usb.o >/dev/null 2>&1 mv -f .deps/libusb_1_0_la-darwin_usb.Tpo .deps/libusb_1_0_la-darwin_usb.Plo /bin/sh ../libtool --tag=CC --mode=compile /Users/xiaofanc/bin/libexec/ccc-analyzer -DHAVE_CONFIG_H -I. -I../../libusbx/libusb -I.. -fvisibility=hidden -std=gnu99 -Wall -Wundef -Wunused -Wstrict-prototypes -Werror-implicit-function-declaration -Wno-pointer-sign -Wshadow -g -O2 -MT libusb_1_0_la-threads_posix.lo -MD -MP -MF .deps/libusb_1_0_la-threads_posix.Tpo -c -o libusb_1_0_la-threads_posix.lo `test -f 'os/threads_posix.c' || echo '../../libusbx/libusb/'`os/threads_posix.c libtool: compile: /Users/xiaofanc/bin/libexec/ccc-analyzer -DHAVE_CONFIG_H -I. -I../../libusbx/libusb -I.. -fvisibility=hidden -std=gnu99 -Wall -Wundef -Wunused -Wstrict-prototypes -Werror-implicit-function-declaration -Wno-pointer-sign -Wshadow -g -O2 -MT libusb_1_0_la-threads_posix.lo -MD -MP -MF .deps/libusb_1_0_la-threads_posix.Tpo -c ../../libusbx/libusb/os/threads_posix.c -fno-common -DPIC -o .libs/libusb_1_0_la-threads_posix.o libtool: compile: /Users/xiaofanc/bin/libexec/ccc-analyzer -DHAVE_CONFIG_H -I. -I../../libusbx/libusb -I.. -fvisibility=hidden -std=gnu99 -Wall -Wundef -Wunused -Wstrict-prototypes -Werror-implicit-function-declaration -Wno-pointer-sign -Wshadow -g -O2 -MT libusb_1_0_la-threads_posix.lo -MD -MP -MF .deps/libusb_1_0_la-threads_posix.Tpo -c ../../libusbx/libusb/os/threads_posix.c -o libusb_1_0_la-threads_posix.o >/dev/null 2>&1 mv -f .deps/libusb_1_0_la-threads_posix.Tpo .deps/libusb_1_0_la-threads_posix.Plo /bin/sh ../libtool --tag=CC --mode=link /Users/xiaofanc/bin/libexec/ccc-analyzer -fvisibility=hidden -std=gnu99 -Wall -Wundef -Wunused -Wstrict-prototypes -Werror-implicit-function-declaration -Wno-pointer-sign -Wshadow -g -O2 -version-info 1:0:1 -no-undefined -Wl,-prebind -o libusb-1.0.la -rpath /usr/local/Cellar/libusb/HEAD/lib libusb_1_0_la-core.lo libusb_1_0_la-descriptor.lo libusb_1_0_la-io.lo libusb_1_0_la-sync.lo libusb_1_0_la-darwin_usb.lo libusb_1_0_la-threads_posix.lo -lobjc -Wl,-framework,IOKit -Wl,-framework,CoreFoundation libtool: link: gcc -dynamiclib -o .libs/libusb-1.0.0.dylib .libs/libusb_1_0_la-core.o .libs/libusb_1_0_la-descriptor.o .libs/libusb_1_0_la-io.o .libs/libusb_1_0_la-sync.o .libs/libusb_1_0_la-darwin_usb.o .libs/libusb_1_0_la-threads_posix.o -lobjc -O2 -Wl,-prebind -Wl,-framework -Wl,IOKit -Wl,-framework -Wl,CoreFoundation -install_name /usr/local/Cellar/libusb/HEAD/lib/libusb-1.0.0.dylib -compatibility_version 2 -current_version 2.0 -Wl,-single_module libtool: link: (cd ".libs" && rm -f "libusb-1.0.dylib" && ln -s "libusb-1.0.0.dylib" "libusb-1.0.dylib") libtool: link: ar cru .libs/libusb-1.0.a libusb_1_0_la-core.o libusb_1_0_la-descriptor.o libusb_1_0_la-io.o libusb_1_0_la-sync.o libusb_1_0_la-darwin_usb.o libusb_1_0_la-threads_posix.o libtool: link: ranlib .libs/libusb-1.0.a libtool: link: ( cd ".libs" && rm -f "libusb-1.0.la" && ln -s "../libusb-1.0.la" "libusb-1.0.la" ) Making all in doc make[2]: Nothing to be done for `all'. Making all in examples /Users/xiaofanc/bin/libexec/ccc-analyzer -DHAVE_CONFIG_H -I. -I../../libusbx/examples -I.. -I../../libusbx/libusb -std=gnu99 -Wall -Wundef -Wunused -Wstrict-prototypes -Werror-implicit-function-declaration -Wno-pointer-sign -Wshadow -g -O2 -MT listdevs.o -MD -MP -MF .deps/listdevs.Tpo -c -o listdevs.o ../../libusbx/examples/listdevs.c mv -f .deps/listdevs.Tpo .deps/listdevs.Po /bin/sh ../libtool --tag=CC --mode=link /Users/xiaofanc/bin/libexec/ccc-analyzer -std=gnu99 -Wall -Wundef -Wunused -Wstrict-prototypes -Werror-implicit-function-declaration -Wno-pointer-sign -Wshadow -g -O2 -o listdevs listdevs.o ../libusb/libusb-1.0.la -lobjc -Wl,-framework,IOKit -Wl,-framework,CoreFoundation libtool: link: /Users/xiaofanc/bin/libexec/ccc-analyzer -std=gnu99 -Wall -Wundef -Wunused -Wstrict-prototypes -Werror-implicit-function-declaration -Wno-pointer-sign -Wshadow -g -O2 -o .libs/listdevs listdevs.o -Wl,-framework -Wl,IOKit -Wl,-framework -Wl,CoreFoundation ../libusb/.libs/libusb-1.0.dylib -lobjc clang: warning: argument unused during compilation: '-std=gnu99' /Users/xiaofanc/bin/libexec/ccc-analyzer -DHAVE_CONFIG_H -I. -I../../libusbx/examples -I.. -I../../libusbx/libusb -std=gnu99 -Wall -Wundef -Wunused -Wstrict-prototypes -Werror-implicit-function-declaration -Wno-pointer-sign -Wshadow -g -O2 -MT xusb.o -MD -MP -MF .deps/xusb.Tpo -c -o xusb.o ../../libusbx/examples/xusb.c mv -f .deps/xusb.Tpo .deps/xusb.Po /bin/sh ../libtool --tag=CC --mode=link /Users/xiaofanc/bin/libexec/ccc-analyzer -std=gnu99 -Wall -Wundef -Wunused -Wstrict-prototypes -Werror-implicit-function-declaration -Wno-pointer-sign -Wshadow -g -O2 -o xusb xusb.o ../libusb/libusb-1.0.la -lobjc -Wl,-framework,IOKit -Wl,-framework,CoreFoundation libtool: link: /Users/xiaofanc/bin/libexec/ccc-analyzer -std=gnu99 -Wall -Wundef -Wunused -Wstrict-prototypes -Werror-implicit-function-declaration -Wno-pointer-sign -Wshadow -g -O2 -o .libs/xusb xusb.o -Wl,-framework -Wl,IOKit -Wl,-framework -Wl,CoreFoundation ../libusb/.libs/libusb-1.0.dylib -lobjc clang: warning: argument unused during compilation: '-std=gnu99' /Users/xiaofanc/bin/libexec/ccc-analyzer -DHAVE_CONFIG_H -I. -I../../libusbx/examples -I.. -I../../libusbx/libusb -std=gnu99 -Wall -Wundef -Wunused -Wstrict-prototypes -Werror-implicit-function-declaration -Wno-pointer-sign -Wshadow -g -O2 -MT dpfp.o -MD -MP -MF .deps/dpfp.Tpo -c -o dpfp.o ../../libusbx/examples/dpfp.c ../../libusbx/examples/dpfp.c:167:40: warning: Result of 'malloc' is converted to a pointer of type 'unsigned char', which is incompatible with sizeof operand type 'struct libusb_control_setup' unsigned char *buf = (unsigned char*) malloc(LIBUSB_CONTROL_SETUP_SIZE + 1); ~~~~~~~~~~~~~~~ ^~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~ 1 warning generated. mv -f .deps/dpfp.Tpo .deps/dpfp.Po /bin/sh ../libtool --tag=CC --mode=link /Users/xiaofanc/bin/libexec/ccc-analyzer -std=gnu99 -Wall -Wundef -Wunused -Wstrict-prototypes -Werror-implicit-function-declaration -Wno-pointer-sign -Wshadow -g -O2 -o dpfp dpfp.o ../libusb/libusb-1.0.la -lobjc -Wl,-framework,IOKit -Wl,-framework,CoreFoundation libtool: link: /Users/xiaofanc/bin/libexec/ccc-analyzer -std=gnu99 -Wall -Wundef -Wunused -Wstrict-prototypes -Werror-implicit-function-declaration -Wno-pointer-sign -Wshadow -g -O2 -o .libs/dpfp dpfp.o -Wl,-framework -Wl,IOKit -Wl,-framework -Wl,CoreFoundation ../libusb/.libs/libusb-1.0.dylib -lobjc clang: warning: argument unused during compilation: '-std=gnu99' /Users/xiaofanc/bin/libexec/ccc-analyzer -DHAVE_CONFIG_H -I. -I../../libusbx/examples -I.. -I../../libusbx/libusb -std=gnu99 -Wall -Wundef -Wunused -Wstrict-prototypes -Werror-implicit-function-declaration -Wno-pointer-sign -Wshadow -g -O2 -MT dpfp_threaded-dpfp_threaded.o -MD -MP -MF .deps/dpfp_threaded-dpfp_threaded.Tpo -c -o dpfp_threaded-dpfp_threaded.o `test -f 'dpfp_threaded.c' || echo '../../libusbx/examples/'`dpfp_threaded.c ../../libusbx/examples/dpfp_threaded.c:196:40: warning: Result of 'malloc' is converted to a pointer of type 'unsigned char', which is incompatible with sizeof operand type 'struct libusb_control_setup' unsigned char *buf = (unsigned char*) malloc(LIBUSB_CONTROL_SETUP_SIZE + 1); ~~~~~~~~~~~~~~~ ^~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~ 1 warning generated. mv -f .deps/dpfp_threaded-dpfp_threaded.Tpo .deps/dpfp_threaded-dpfp_threaded.Po /bin/sh ../libtool --tag=CC --mode=link /Users/xiaofanc/bin/libexec/ccc-analyzer -std=gnu99 -Wall -Wundef -Wunused -Wstrict-prototypes -Werror-implicit-function-declaration -Wno-pointer-sign -Wshadow -g -O2 -o dpfp_threaded dpfp_threaded-dpfp_threaded.o ../libusb/libusb-1.0.la -lobjc -Wl,-framework,IOKit -Wl,-framework,CoreFoundation libtool: link: /Users/xiaofanc/bin/libexec/ccc-analyzer -std=gnu99 -Wall -Wundef -Wunused -Wstrict-prototypes -Werror-implicit-function-declaration -Wno-pointer-sign -Wshadow -g -O2 -o .libs/dpfp_threaded dpfp_threaded-dpfp_threaded.o -Wl,-framework -Wl,IOKit -Wl,-framework -Wl,CoreFoundation ../libusb/.libs/libusb-1.0.dylib -lobjc clang: warning: argument unused during compilation: '-std=gnu99' make[2]: Nothing to be done for `all-am'. scan-build: 3 bugs found. scan-build: Run 'scan-view /var/folders/_k/njr5n6mj09924bn1rfxx3slh0000gn/T/scan-build-2012-06-30-2' to examine bug reports. scan-build: Analysis run complete. scan-build: Viewing analysis results in '/var/folders/_k/njr5n6mj09924bn1rfxx3slh0000gn/T/scan-build-2012-06-30-2' using scan-view. Starting scan-view at: http://127.0.0.1:8181 Use Ctrl-C to exit. -- Xiaofan ------------------------------------------------------------------------------ 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/ _______________________________________________ libusbx-devel mailing list libusbx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/libusbx-devel