<div dir="ltr">Thanks for the feedback. I agree for the same reasons as you that the Coding Standards don't quite feel like the right place for it, but I'm unaware of anywhere else. I'll give this a day or two to see if there are any more comments before looking at a patch.<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, 23 Mar 2020 at 17:36, David Blaikie <<a href="mailto:dblaikie@gmail.com">dblaikie@gmail.com</a>> wrote:<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 dir="ltr">Sounds good to me - and I guess the LLVM coding standards would be the place to put it, though it feels a smidge out of place since it's about external facing functionality, where the coding standards don't usually touch on that. It does sort of feel like it's adjacent to the comment style documentation (though that goes the other way - full sentences with capital/full stop - not that the difference is a problem & I think it's fine/correct that these be as they are/as you're suggesting): <a href="https://llvm.org/docs/CodingStandards.html#comment-formatting" target="_blank">https://llvm.org/docs/CodingStandards.html#comment-formatting</a></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Mar 23, 2020 at 8:54 AM James Henderson via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:<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 dir="ltr"><div>Hi all,</div><div><br></div><div>This came up in a recent review. There is currently no documented style for how to write error messages. For example, should they start with a capital letter or end in a full stop? Consequently, there's quite a bit of inconsistency in our diagnostics throughout the code base.</div><div><br></div><div>clang typically emits error messages with no leading capital letter and no trailing full stop. For example:</div><div><br></div><div>C:\>clang<br></div><div>"clang: error: no input files"</div><div><br></div><div>I have suggested this approach be followed in many different reviews, primarily in the LLVM equivalents of the GNU binutils that I typically work on. I'd like to propose that this be followed more widely too, and documented in the coding standards as such. Note, I am not proposing changing existing error messages as part of this. Do people agree with this proposal? If not, what would you prefer to see?<br></div><div><br></div><div>As well as "regular" errors you'll see in typical usage, there are 3 other kinds of errors that are widely used, with the following output styles:</div><div><br></div><div>Assertion failures:</div><div><br></div><div>Assertion failed: false && "this is the message", file <filepath><br></div><div><br></div><div>llvm_unreachable failures:</div><div><br></div><div>this is the message<br>UNREACHABLE executed at <filepath></div><div><br></div><div>report_fatal_error failures:</div><div><br></div><div>LLVM ERROR: this is the message</div><div><br></div><div>Looking at the existing output, and how they are used, I think llvm_unreachable and assertions do not need standardising, since they are purely for internal usage, whilst report_fatal_error should be standardised to the same as other normal errors (i.e. lower-case first letter, trailing full stop).</div><div><br></div><div>What do people think?</div><div><br></div><div>James<br></div></div>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div>
</blockquote></div>