http://llvm.org/bugs/show_bug.cgi?id=18980

            Bug ID: 18980
           Summary: Confusing location information of -Wunused-value
                    warnings
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    Classification: Unclassified

@trunk trunk 202299

The expression (i ? pf : pv) has no side effect, and therefore the computed
value is not used. Clang indicates that "pf" is not used. But to me it seems
not complete, as "pv" is also not used. 


$: cat s.c 
void a(int i) {
  int (*pf)[2];
  int (*pv)[i + 1];
  (i ? pf : pv);
}
$: clang-trunk -Wunused-value -c s.c
s.c:4:8: warning: expression result unused [-Wunused-value]
  (i ? pf : pv);
       ^~
1 warning generated.


$: gcc-trunk -Wunused-value -c s.c
s.c: In function ‘a’:
s.c:4:3: warning: statement with no effect [-Wunused-value]
   (i ? pf : pv);
   ^

-- 
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

Reply via email to