<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br><div><div>On 30 jul 2014, at 11:38, Björn Gustavsson <<a href="mailto:bjorn@erlang.org">bjorn@erlang.org</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">On Sat, Jul 19, 2014 at 6:11 PM, José Valim<br><<a href="mailto:jose.valim@plataformatec.com.br">jose.valim@plataformatec.com.br</a>> wrote:<br><blockquote type="cite">Given the following code:<br><br>-module(foo).<br>-compile(export_all).<br><br>bar() -><br> [{foo, hello:world() == bar}],<br> ok.<br><br><br>When compiled, it reports:<br><br>foo.erl:5: Warning: a term is constructed, but never used<br>foo.erl:5: Warning: use of operator '=:=' has no effect<br></blockquote><br>Unfortunately it is not that easy to fix.<br><br>The compiler rewrites '==' to '=:=' if<br>it can know that the result will be the<br>same ('=:=' is slightly more efficient than<br>'=='). It does that rewriting before it has<br>found out that the result of the expression<br>is not used.<br></blockquote><div><br></div>Why not just change the error message into:</div><div>foo.erl:5 Warning: use of operator =:= (or ==) has no effect </div><div><br></div><div>Or something similar. Not too complex I guess :-)</div><div><br></div><div>/Tony</div><div><br><blockquote type="cite"><br>While I can think of a few ways to fix the<br>problem, they are all more complex than I<br>would like.<br><br>/Bjorn<br>-- <br>Björn Gustavsson, Erlang/OTP, Ericsson AB<br>_______________________________________________<br>erlang-bugs mailing list<br><a href="mailto:erlang-bugs@erlang.org">erlang-bugs@erlang.org</a><br>http://erlang.org/mailman/listinfo/erlang-bugs<br></blockquote></div><br><div>
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div><span class="Apple-style-span" style="color: rgb(51, 51, 51); font-family: Geneva, Arial, Helvetica, sans-serif; font-size: 12px; ">"Installing applications can lead to corruption over time. </span><span class="Apple-style-span" style="color: rgb(51, 51, 51); font-family: Geneva, Arial, Helvetica, sans-serif; font-size: 12px; ">Applications gradually write over each other's libraries, partial upgrades occur, user and system errors happen, and minute changes may be unnoticeable and difficult to fix"</span></div><div><span class="Apple-style-span" style="color: rgb(51, 51, 51); font-family: Geneva, Arial, Helvetica, sans-serif; font-size: 12px; "><br></span></div></span><br class="Apple-interchange-newline">
</div>
<br></body></html>