[llvm-bugs] [Bug 31578] New: no warning for comma within sizeof

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Jan 8 07:29:07 PST 2017


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: unassignedclangbugs at nondot.org
          Reporter: prathamesh.kulkarni at linaro.org
                CC: llvm-bugs at lists.llvm.org
    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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20170108/c6d06848/attachment.html>


More information about the llvm-bugs mailing list