http://llvm.org/bugs/show_bug.cgi?id=14968
Bug #: 14968
Summary: -Wunused-value should not warn about unused constant
expanded from a macro
Product: clang
Version: 3.2
Platform: PC
OS/Version: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: Frontend
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected]
Classification: Unclassified
In Git's source code, the following pattern is used to "Let callers be aware of
the constant return value; this can help gcc with -Wuninitialized analysis.":
int foo(int a);
#define foo(a) (foo(a), 1);
void bar(int a) {
foo(a);
}
With clang, this causes warnings of the form:
test.c:5:3: warning: expression result unused [-Wunused-value]
foo(a);
^~~~~~
test.c:2:28: note: expanded from macro 'foo'
#define foo(a) (foo(a), 1);
^
This seems similar to bug 13747, so is this considered to be a bug in clang or
is it a case of "don't do that"?
--
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs