[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
a few warnings in the 'ANSI C-conforming const' check when using clang
From: |
Austin English |
Subject: |
a few warnings in the 'ANSI C-conforming const' check when using clang |
Date: |
Tue, 14 Jun 2011 18:47:57 -0700 |
I was recently testing Wine with the Clang static analyzer, which
found a few issues in wine's configure.ac:
http://source.winehq.org/git/wine.git/commitdiff/8521ebe79df39730ee62d518fde3751f45606061
there are a few more warnings, however, that come from autoconf itself:
address@hidden ~/wine-git $
~/src/llvm/tools/clang/tools/scan-build/scan-build clang foo.c
scan-build: 'clang' executable not found in
'/home/austin/src/llvm/tools/clang/tools/scan-build/bin'.
scan-build: Using 'clang' from path: /usr/local/bin/clang
foo.c:31:5: warning: Dereference of undefined pointer value
*t++ = 0;
^
foo.c:22:22: warning: Both operands to '-' always have the same value
pcpcc = &g + (g ? g-g : 0);
~^~
foo.c:22:14: warning: The right operand to '+' is always 0
pcpcc = &g + (g ? g-g : 0);
^ ~~~~~~~~~~~~~
foo.c:26:3: warning: Value stored to 'pcpcc' is never read
pcpcc = (char const *const *) ppc;
^ ~~~~~~~~~~~~~~~~~~~~~~~~~
4 warnings generated.
scan-build: 4 bugs found.
scan-build: Run 'scan-view /tmp/scan-build-2011-06-14-3' to examine bug reports.
foo.c is attached, which is just that configure test in a standalone c file.
--
-Austin
foo.c
Description: Text Data
- a few warnings in the 'ANSI C-conforming const' check when using clang,
Austin English <=