[PATCH] D76833: [CodingStandards] Document coding standard for error and warning messages

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 1 13:32:16 PDT 2020


dblaikie added inline comments.


================
Comment at: llvm/docs/CodingStandards.rst:338
+
+  error: file.o: section header 3 is corrupt. Size is 10 when it should be 20
+
----------------
jhenderson wrote:
> rnk wrote:
> > If you look at clang diagnostics, I think most of the time we would use a semicolon to separate sentences here, so it would look like this:
> >   error: file.o: section header 3 is corrupt; size is 10 when it should be 20
> > 
> > However, overall this is useful guidance, and if you want to leave this example as is for migrating existing multi-sentence diagnostics, that's OK with me.
> Thanks for the comment. I think there's less clear consensus in the tools on what to do about mid-message ends of sentences. I know that there are several messages following `<part1>. <part2>` style and also `<part1>: <part2>` etc. Let's leave this as is for now.
If there's lack of consensus it might be preferable for this document not to take a stance on the issue? (either drop this bit entirely, or include alternatives equally - especially if clang's convention isn't shown here (& yeah, I find "this is a fragment. This is a sentence" pretty weird/surprising - given how used to clang's conventions I am), since it's the biggest surface area/usage of diagnostics in the project)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D76833/new/

https://reviews.llvm.org/D76833





More information about the llvm-commits mailing list