<div dir="ltr">Curtesy says that you should copy the list when you reply (in other words, use "reply to all"). <br><br><br><div class="gmail_extra"><br><div class="gmail_quote">On 16 February 2016 at 10:05, Swaresh Sankpal <span dir="ltr"><<a href="mailto:swaresh123@gmail.com" target="_blank">swaresh123@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><p dir="ltr">I actually want to catch such errors and give feedback in simple language so that new programmers can correct the error or I could give a link to that may help in correcting errors.<br><br></p></blockquote><div>So, you want to translate error messages to a more verbose form? <br><br></div><div>I'm reasonably sure thats a pretty hard thing to do in the more general case. Sure, some very trivial errors may be possible, but in the general situation with mistakes that novices and more experienced programmers end up making, I'd say giving a more "user friendly" error message is going to be quite difficult. <br><br></div><div>By the way, the example you gave is an interesting one, because it would appear that clang does a bit of implicit casting, before deciding that types are incorrect.<br><br>ptr.c:6:12: error: invalid operands to binary expression ('float' and 'float')<br>        int y = f % x;<br>                ~ ^ ~<br></div><div>This can be confusing, but I would argue that this is best fixed by undoing the type-casts before issuing the error message (or the types related to it). <br><br></div><div>As to catching logical errors [in a second email to me privately], it's even harder - whilst SOME logical errors are relatively easy to spot, most are not - this is called "the halting problem". <br><br></div><div>double x = 0.0;<br></div><div>while(sin(x) <= 1.0) { x+= 0.01; }<br><br></div><div>will run forever, if sin doesn't have an errror that results in > 1.0 answers - but how do you know that from a programmatic standpoint?<br></div><div><br>--<br></div><div>Mats<br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class=""><div class="h5">
<div class="gmail_quote">On 16-Feb-2016 3:18 pm, "mats petersson" <<a href="mailto:mats@planetcatfish.com" target="_blank">mats@planetcatfish.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Can you give an example that actually compiles, and the expected output?  (using % on a float value doesn't compile, because both sides need to be integer).<br><br>--<br></div>Mats<br></div><div class="gmail_extra"><br><div class="gmail_quote">On 16 February 2016 at 09:27, Swaresh Sankpal via cfe-dev <span dir="ltr"><<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi,<br><br>I am very new to clang and llvm.I want to build a clang tool to give automated feedback by analyzing c++ source code.Input to the tool is a c++ code and output should be feedback related to small problems that i implement(like say modulus operation on floating point number).Feedback will be given input as a string.How to proceed with such a problem.Please help.Any example doing similar kind of thing will be very helpful.<div><br></div><div>Swaresh</div><div>IIT Bombay.</div></div>
<br>_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
<br></blockquote></div><br></div>
</blockquote></div>
</div></div></blockquote></div><br></div></div>