[PATCH] D10634: Loss of Sign Checker

Daniel Marjamäki daniel.marjamaki at evidente.se
Mon Jul 6 06:06:37 PDT 2015


Here is a bigger log with more warnings.

there are some cases where I don't think there should be a warning.. for instance some compound assignments:

args.c:990:9: warning: assigning negative value to unsigned variable loses sign and may cause undesired runtime behavior [clang-analyzer-alpha.core.LossOfSignAssign]

  tmp /= 10;
      ^

read.c:4940:13: warning: assigning negative value to unsigned variable loses sign and may cause undesired runtime behavior [clang-analyzer-alpha.core.LossOfSignAssign]

  value >>= 7;
        ^

I am not an expert but it seems strange to me that clang seems to think that 10 and 7 are negative. Can you investigate this?


http://reviews.llvm.org/D10634







More information about the cfe-commits mailing list