llvm does not analyze cfg and produces incorrect warnings |
|||||||
Issue descriptionThis is the upstream bug https://bugs.llvm.org//show_bug.cgi?id=10030 Kernel folks who are trying to move to clang are hitting it: https://lkml.org/lkml/2017/3/11/61 From the upstream bug: "Consider the following input: int foo = 1 > 2 ? 1 << -1 : 0; This results in a warning about the negative shift, even if that branch of the ternary operator is known to be unused. This does work inside a function e.g. as statement."
,
Mar 22 2017
Simple repro case:
(cr) (master) manojgupta@manojgupta ~/trunk/src/scripts $ cat a.c
int foo = 1 > 2 ? 1 << -1 : 0;
int main()
{
return foo;
}
(cr) (master) manojgupta@manojgupta ~/trunk/src/scripts $ clang a.c
a.c:1:21: warning: shift count is negative [-Wshift-count-negative]
int foo = 1 > 2 ? 1 << -1 : 0;
^ ~~
1 warning generated.
,
Mar 24 2017
,
Sep 25 2017
mka@ Do you still need this one?
,
Dec 26 2017
,
Jan 2 2018
[It appears that a bunch of old cros issues bulk-added the "Infra" component recently, but they should probably be "Infra>Client>ChromeOS".]
,
Jan 3 2018
,
Jan 4 2018
,
Feb 5 2018
|
|||||||
►
Sign in to add a comment |
|||||||
Comment 1 by manojgupta@chromium.org
, Mar 21 2017