<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<br>
<div class="moz-cite-prefix">On 03/31/2014 09:21 AM, Ted Kremenek
wrote:<br>
</div>
<blockquote
cite="mid:A2EC5687-B518-462C-905B-12538B456937@apple.com"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">
On Mar 31, 2014, at 9:08 AM, Jordan Rose <<a
moz-do-not-send="true" href="mailto:jordan_rose@apple.com">jordan_rose@apple.com</a>>
wrote:<br>
<div><br class="Apple-interchange-newline">
<blockquote type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space;
-webkit-line-break: after-white-space;"><br>
<div>
<div>On Mar 30, 2014, at 19:47 , Kyle Sluder <<a
moz-do-not-send="true" href="mailto:kyle@ksluder.com">kyle@ksluder.com</a>>
wrote:</div>
<br class="Apple-interchange-newline">
<blockquote type="cite">On Mar 28, 2014, at 1:52 PM,
Jordan Rose <<a moz-do-not-send="true"
href="mailto:jordan_rose@apple.com">jordan_rose@apple.com</a>>
wrote:<br>
<blockquote type="cite"><br>
Hi, Daniel. We already have this in Clang itself as
-Wimplicit-fallthrough,<br>
</blockquote>
<br>
That warning triggers for every fallthrough. Daniel’s
checker only triggers for assignments that are redundant
with assignments made in cases that are fallen into.<br>
<br>
These are philosophically different approaches, and they
are mutually compatible. Even if -Wimplicit-fallthrough
becomes useful to C/ObjC programmers via the
__fallthrough macro, Daniel’s checker is still useful
because it will catch logic bugs in code that
redundantly assigns to the same variable in two
different cases.<br>
</blockquote>
</div>
<br>
<div>Ah, interesting. Isn't this already caught with the
dead stores checker, though?</div>
<div><br>
</div>
<div>
<div style="margin: 0px; font-size: 11px; font-family:
Menlo; color: rgb(148, 58, 32); background-color:
rgb(223, 219, 196);"><b><stdin>:5:5: </b><span
style="color: #c02ec0"><b>warning: </b></span><b>Value
stored to 'y' is never read</b></div>
<div style="margin: 0px; font-size: 11px; font-family:
Menlo; color: rgb(76, 47, 45); background-color:
rgb(223, 219, 196);"> y = 1;</div>
<div style="margin: 0px; font-size: 11px; font-family:
Menlo; color: rgb(0, 165, 0); background-color: rgb(223,
219, 196);"><b> ^ ~</b></div>
</div>
<div><b><br>
</b></div>
<div>We could probably stand to improve that checker to say
<i>why</i> something's a dead store, but I don't think we
need a separate pass.</div>
<div><br>
</div>
<div>Jordan</div>
</div>
</blockquote>
<br>
</div>
<div>Agreed. I’d rather we have the general dead stores checker
(and make it better) then have something more specialized like
this. The dead stores checker has also been hardened over
several years to handle many common idioms of defensive code
that are “dead” but not interesting.</div>
<br>
</blockquote>
Speaking as someone who has tried to use the static analyser on a
largish code base in the recent past, I would *much* rather see a
separate checker. We have literally hundreds of false positives
from dead stores and actively ignore them. A "dead store due to
fall-through case" on the other hand is likely a bug and is thus
very interesting.<br>
<br>
To be clear, I'm most commenting on reporting *interface* not
*implementation*.<br>
<br>
Philip<br>
</body>
</html>