Created attachment 3966
Testcase
I've attached a testcase showing this problem. Clang correctly detects that the
return value from PlaneGetDist() is unused, but the normal vector (N) from
PlaneGetNormal is also unused, and Clang doesn't warn about this.
I suspect this might require IPA functionality, so feel free to mark it as a
duplicate of another bug - I don't feel I have enough experience with Clang to
know for sure whether this is a duplicate.
Compile as: scan-build gcc unused.c -Wunused-parameter -Wall
ANALYZE: unused.c PlaneGetNormal
ANALYZE: unused.c PlaneGetDist
ANALYZE: unused.c main
unused.c:34:3: warning: Value stored to 'd' is never read
d = PlaneGetDist (P);
^ ~~~~~~~~~~~~~~~~
1 diagnostic generated.
scan-build: 1 bugs found.
scan-build: Run 'scan-view /tmp/scan-build-2009-12-21-16' to examine bug
reports.
unused.c
(599 bytes, text/plain)