https://gcc.gnu.org/g:68aefc6988dc34d4b9a2194f9fb08bccfe7a076b
commit r15-5927-g68aefc6988dc34d4b9a2194f9fb08bccfe7a076b Author: David Malcolm <dmalc...@redhat.com> Date: Wed Dec 4 15:01:34 2024 -0500 libgdiagnostics: documentation tweaks gcc/ChangeLog: * doc/libgdiagnostics/topics/execution-paths.rst: Add '§' before references to section of SARIF spec. * doc/libgdiagnostics/topics/fix-it-hints.rst: Likewise. * doc/libgdiagnostics/tutorial/01-hello-world.rst: Fix typo. * doc/libgdiagnostics/tutorial/02-physical-locations.rst: Likewise. * doc/libgdiagnostics/tutorial/04-notes.rst: Likewise. * doc/libgdiagnostics/tutorial/06-fix-it-hints.rst: Add link to diagnostic_add_fix_it_hint_replace. * doc/libgdiagnostics/tutorial/07-execution-paths.rst: Add '§'. Signed-off-by: David Malcolm <dmalc...@redhat.com> Diff: --- gcc/doc/libgdiagnostics/topics/execution-paths.rst | 2 +- gcc/doc/libgdiagnostics/topics/fix-it-hints.rst | 2 +- gcc/doc/libgdiagnostics/tutorial/01-hello-world.rst | 2 +- gcc/doc/libgdiagnostics/tutorial/02-physical-locations.rst | 2 +- gcc/doc/libgdiagnostics/tutorial/04-notes.rst | 4 ++-- gcc/doc/libgdiagnostics/tutorial/06-fix-it-hints.rst | 3 ++- gcc/doc/libgdiagnostics/tutorial/07-execution-paths.rst | 2 +- 7 files changed, 9 insertions(+), 8 deletions(-) diff --git a/gcc/doc/libgdiagnostics/topics/execution-paths.rst b/gcc/doc/libgdiagnostics/topics/execution-paths.rst index 3f4109ce4f33..01bb95f016e9 100644 --- a/gcc/doc/libgdiagnostics/topics/execution-paths.rst +++ b/gcc/doc/libgdiagnostics/topics/execution-paths.rst @@ -90,4 +90,4 @@ cross-references between events. In particular FIXME Paths are printed to text sinks, and for SARIF sinks each path is added as a ``codeFlow`` object (see SARIF 2.1.0 -`3.36 codeFlow object <https://docs.oasis-open.org/sarif/sarif/v2.1.0/errata01/os/sarif-v2.1.0-errata01-os-complete.html#_Toc141790990>`_). +`§3.36 codeFlow object <https://docs.oasis-open.org/sarif/sarif/v2.1.0/errata01/os/sarif-v2.1.0-errata01-os-complete.html#_Toc141790990>`_). diff --git a/gcc/doc/libgdiagnostics/topics/fix-it-hints.rst b/gcc/doc/libgdiagnostics/topics/fix-it-hints.rst index 08acb7119a14..6854ea0d14d8 100644 --- a/gcc/doc/libgdiagnostics/topics/fix-it-hints.rst +++ b/gcc/doc/libgdiagnostics/topics/fix-it-hints.rst @@ -40,7 +40,7 @@ to add fix-it hints without each needing extensive checking. Fix-it hints are printed to text sinks, and are emitted by SARIF sinks as ``fix`` objects (see SARIF 2.1.0 -`3.55 fix object <https://docs.oasis-open.org/sarif/sarif/v2.1.0/errata01/os/sarif-v2.1.0-errata01-os-complete.html#_Toc141791131>`_). +`§3.55 fix object <https://docs.oasis-open.org/sarif/sarif/v2.1.0/errata01/os/sarif-v2.1.0-errata01-os-complete.html#_Toc141791131>`_). Fix-it hints within a :type:`diagnostic` are "atomic": if any hints can't be applied, none of them will be, and no fix-its hints will be displayed diff --git a/gcc/doc/libgdiagnostics/tutorial/01-hello-world.rst b/gcc/doc/libgdiagnostics/tutorial/01-hello-world.rst index 6596734546fb..f616d27e2ceb 100644 --- a/gcc/doc/libgdiagnostics/tutorial/01-hello-world.rst +++ b/gcc/doc/libgdiagnostics/tutorial/01-hello-world.rst @@ -124,7 +124,7 @@ terminal, and the quotes will be internationalized, so that e.g. with .. code-block:: console - progname: erreur: can't find « free » + progname: erreur: can't find « foo » Note that: diff --git a/gcc/doc/libgdiagnostics/tutorial/02-physical-locations.rst b/gcc/doc/libgdiagnostics/tutorial/02-physical-locations.rst index 71d836edb28c..cb7aefbf81b7 100644 --- a/gcc/doc/libgdiagnostics/tutorial/02-physical-locations.rst +++ b/gcc/doc/libgdiagnostics/tutorial/02-physical-locations.rst @@ -165,7 +165,7 @@ underling the pertinent part of the given line. If libgdiagnostics cannot open the file, it will merely print:: - foo.c:17:8: error: can't find 'foo' + foo.c:17:8: error: can't find 'foo.h' A range can span multiple lines within the same file. diff --git a/gcc/doc/libgdiagnostics/tutorial/04-notes.rst b/gcc/doc/libgdiagnostics/tutorial/04-notes.rst index 81755b220be7..da03af05f492 100644 --- a/gcc/doc/libgdiagnostics/tutorial/04-notes.rst +++ b/gcc/doc/libgdiagnostics/tutorial/04-notes.rst @@ -24,7 +24,7 @@ Let's further extend the previous example to add a "note" to it. We want to generate output like this:: - test-with-note.c:17:11: error: can't find 'foo' + test-with-note.c:17:11: error: can't find 'foo.h' 17 | #include <foo.h> | ^~~~~ test-with-note.c:17:11: note: have you looked behind the couch? @@ -42,7 +42,7 @@ to the diagnostics. On compiling and running the program, we should get the desired output:: - test-with-note.c:17:11: error: can't find 'foo' + test-with-note.c:17:11: error: can't find 'foo.h' 17 | #include <foo.h> | ^~~~~ test-with-note.c:17:11: note: have you looked behind the couch? diff --git a/gcc/doc/libgdiagnostics/tutorial/06-fix-it-hints.rst b/gcc/doc/libgdiagnostics/tutorial/06-fix-it-hints.rst index f3c32ad1ce2d..35af4c82c0ca 100644 --- a/gcc/doc/libgdiagnostics/tutorial/06-fix-it-hints.rst +++ b/gcc/doc/libgdiagnostics/tutorial/06-fix-it-hints.rst @@ -24,7 +24,8 @@ libgdiagnostics supports adding "fix-it hints" to a :type:`diagnostic`: suggestions for the user on how to edit their code to fix a problem. These can be expressed as insertions, replacements, and removals of text. -For example, here we add a replacement fix-it hint to a diagnostic: +For example, here we use :func:`diagnostic_add_fix_it_hint_replace` to add +a replacement fix-it hint to a diagnostic: .. literalinclude:: ../../../testsuite/libgdiagnostics.dg/test-fix-it-hint.c :language: c diff --git a/gcc/doc/libgdiagnostics/tutorial/07-execution-paths.rst b/gcc/doc/libgdiagnostics/tutorial/07-execution-paths.rst index 3c0ba7154184..3b626c01aca4 100644 --- a/gcc/doc/libgdiagnostics/tutorial/07-execution-paths.rst +++ b/gcc/doc/libgdiagnostics/tutorial/07-execution-paths.rst @@ -124,7 +124,7 @@ then we should get output to text sinks similar to the following:: | (3) when calling 'PyList_Append', passing NULL from (1) as argument 1 and for SARIF sinks the path will be added as a ``codeFlow`` object -(see SARIF 2.1.0 `3.36 codeFlow object <https://docs.oasis-open.org/sarif/sarif/v2.1.0/errata01/os/sarif-v2.1.0-errata01-os-complete.html#_Toc141790990>`_). +(see SARIF 2.1.0 `§3.36 codeFlow object <https://docs.oasis-open.org/sarif/sarif/v2.1.0/errata01/os/sarif-v2.1.0-errata01-os-complete.html#_Toc141790990>`_). Here's the above example in full: