From 8217f4ed9c652de1f29693eca3958a4a05863bdb Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Mon, 20 Apr 2009 06:26:18 +0000 Subject: [PATCH] more stuff. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69576 91177308-0d34-0410-b5e6-96231b3b80d8 --- docs/UsersManual.html | 53 +++++++++++++++++++++++++++++++++++++++---- 1 file changed, 48 insertions(+), 5 deletions(-) diff --git a/docs/UsersManual.html b/docs/UsersManual.html index 5e6f5565c9..86185754ca 100644 --- a/docs/UsersManual.html +++ b/docs/UsersManual.html @@ -193,9 +193,10 @@ introduces the language selection and other high level options like -c, -g, etc.

Clang aims to produce beautiful diagnostics by default, particularly for new users that first come to Clang. However, different people have different -preferences, and sometimes Clang is driven by another program, not a person. For -these cases, Clang provides a wide range of options to control the exact output -format of the diagnostics that it generates.

+preferences, and sometimes Clang is driven by another program that wants to +parse simple and consistent output, not a person. For these cases, Clang +provides a wide range of options to control the exact output format of the +diagnostics that it generates.

@@ -363,10 +364,52 @@ by commenting them out.

Clang provides a number of ways to control which code constructs cause it to -emit errors and warning messages. +emit errors and warning messages, and how they are displayed to the console.

-error and warning cases +

Controlling How Clang Displays Diagnostics

+

When Clang emits a diagnostic, it includes rich information in the output, +and gives you fine-grain control over which information is printed. Clang has +the ability to print this information, and these are the options that control +it:

+ +

+

    +
  1. A file/line/column indicator that shows exactly where the diagnostic occurs + in your code [-fshow-column, -fshow-source-location].
  2. +
  3. A categorization of the diagnostic as a note, warning, error, or fatal + error.
  4. +
  5. A text string that describes what the problem is.
  6. +
  7. An option that indicates how to control the diagnostic (for diagnostics that + support it) [-fdiagnostics-show-option].
  8. +
  9. The line of source code that the issue occurs on, along with a caret and + ranges that indicate the important locations [-fcaret-diagnostics].
  10. +
  11. "FixIt" information, which is a concise explanation of how to fix the + problem (when Clang is certain it knows) [-fdiagnostics-fixit-info].
  12. +
  13. A machine-parsable representation of the ranges involved (off by + default) [-fprint-source-range-info].
  14. +

+ +

For more information please see Formatting of +Diagnostics.

+ +

Controlling Which Diagnostics Clang Generates

+ +

mappings: ignore, note, warning, error, fatal

+ +

+The two major classes are control from the command line and control via pragmas +in your code.

+ + +

-W flags, -pedantic, etc

+ +

pragma GCC diagnostic

Precompiled Headers

-- 2.40.0