[llvm-bugs] [Bug 33559] New: -Wshorten-64-to-32 doesn't handle +=

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Jun 22 15:19:56 PDT 2017


            Bug ID: 33559
           Summary: -Wshorten-64-to-32 doesn't handle +=
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Frontend
          Assignee: unassignedclangbugs at nondot.org
          Reporter: smeenai at fb.com
                CC: alexander.v.shaposhnikov at gmail.com,
                    compnerd at compnerd.org, llvm-bugs at lists.llvm.org,
                    richard-llvm at metafoo.co.uk

% cat reduced.c
void f(int x, long long y) {
    x += y;

% clang -fsyntax-only -Wshorten-64-to-32 reduced.c
# no warning

Compare to

% cat reduced.c
void f(int x, long long y) {
    x = x + y;

% clang -fsyntax-only -Wshorten-64-to-32 reduced.c
reduced.c:2:11: warning: implicit conversion loses integer precision: 'long
long' to 'int' [-Wshorten-64-to-32]
    x = x + y;
      ~ ~~^~~
1 warning generated.

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/20170622/11abedb1/attachment.html>

More information about the llvm-bugs mailing list