https://llvm.org/bugs/show_bug.cgi?id=31578
Bug ID: 31578
Summary: no warning for comma within sizeof
Product: clang
Version: 3.8
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: -New Bugs
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected]
Classification: Unclassified
Hi,
For the following test-case:
#include <stddef.h>
size_t f(int n)
{
return sizeof(n, n + 1);
}
gcc -Wall emits diagnostic:
foo.c: In function âfâ:
foo.c:4:18: warning: left-hand operand of comma expression has no effect
[-Wunused-value]
return sizeof(n, n + 1);
^
clang -Wall -Wextra doesn't seem to emit any diagnostic.
clang --version:
clang version 3.8.1-12ubuntu1 (tags/RELEASE_381/final)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
Thanks,
Prathamesh
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs