diff gcc/doc/ux.texi @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents 84e7813d76e9
children
line wrap: on
line diff
--- a/gcc/doc/ux.texi	Thu Oct 25 07:37:49 2018 +0900
+++ b/gcc/doc/ux.texi	Thu Feb 13 11:34:05 2020 +0900
@@ -1,4 +1,4 @@
-@c Copyright (C) 2018 Free Software Foundation, Inc.
+@c Copyright (C) 2018-2020 Free Software Foundation, Inc.
 @c Free Software Foundation, Inc.
 @c This is part of the GCC manual.
 @c For copying conditions, see the file gcc.texi.
@@ -9,7 +9,7 @@
 @cindex guidelines, user experience
 
 To borrow a slogan from
- @uref{https://elm-lang.org/blog/compilers-as-assistants, Elm},
+@uref{https://elm-lang.org/news/compilers-as-assistants, Elm},
 
 @quotation
 @strong{Compilers should be assistants, not adversaries.}  A compiler should
@@ -143,7 +143,7 @@
   at the declaration
 
   @item
-  something is erroneously duplicated (e.g. an error, due to breaking a
+  something is erroneously duplicated (e.g.@: an error, due to breaking a
   uniqueness requirement, or a warning, if it's suggestive of a bug)
 
   @item
@@ -376,12 +376,47 @@
 
 @c %H and %I were added in r248698.
 
+@subsection Group logically-related diagnostics
+
 Use @code{auto_diagnostic_group} when issuing multiple related
 diagnostics (seen in various examples on this page).  This informs the
 diagnostic subsystem that all diagnostics issued within the lifetime
-of the @code{auto_diagnostic_group} are related.  (Currently it doesn't
-do anything with this information, but we may implement that in the
-future).
+of the @code{auto_diagnostic_group} are related.  For example,
+@option{-fdiagnostics-format=json} will treat the first diagnostic
+emitted within the group as a top-level diagnostic, and all subsequent
+diagnostics within the group as its children.
+
+@subsection Quoting
+Text should be quoted by either using the @samp{q} modifier in a directive
+such as @samp{%qE}, or by enclosing the quoted text in a pair of @samp{%<}
+and @samp{%>} directives, and never by using explicit quote characters.
+The directives handle the appropriate quote characters for each language
+and apply the correct color or highlighting.
+
+The following elements should be quoted in GCC diagnostics:
+
+@itemize @bullet
+@item
+Language keywords.
+@item
+Tokens.
+@item
+Boolean, numerical, character, and string constants that appear in the
+source code.
+@item
+Identifiers, including function, macro, type, and variable names.
+@end itemize
+
+Other elements such as numbers that do not refer to numeric constants that
+appear in the source code should not be quoted. For example, in the message:
+
+@smallexample
+argument %d of %qE must be a pointer type
+@end smallexample
+
+@noindent
+since the argument number does not refer to a numerical constant in the
+source code it should not be quoted.
 
 @subsection Spelling and Terminology
 
@@ -400,6 +435,9 @@
 @option{-fdiagnostics-parseable-fixits}.  With the latter, an IDE
 ought to be able to offer to automatically apply the suggested fix.
 
+Fix-it hints contain code fragments, and thus they should not be marked
+for translation.
+
 Fix-it hints can be added to a diagnostic by using a @code{rich_location}
 rather than a @code{location_t} - the fix-it hints are added to the
 @code{rich_location} using one of the various @code{add_fixit} member
@@ -510,7 +548,7 @@
 @end smallexample
 
 @noindent
-which is intended to e.g. replace a @code{std::move} with the underlying
+which is intended to e.g.@: replace a @code{std::move} with the underlying
 value:
 
 @smallexample