GCC Middle and Back End API Reference
context-options.h
Go to the documentation of this file.
1/* Declare enums for diagnostics::context and related types.
2 Copyright (C) 2000-2025 Free Software Foundation, Inc.
3
4This file is part of GCC.
5
6GCC is free software; you can redistribute it and/or modify it under
7the terms of the GNU General Public License as published by the Free
8Software Foundation; either version 3, or (at your option) any later
9version.
10
11GCC is distributed in the hope that it will be useful, but WITHOUT ANY
12WARRANTY; without even the implied warranty of MERCHANTABILITY or
13FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14for more details.
15
16You should have received a copy of the GNU General Public License
17along with GCC; see the file COPYING3. If not see
18<http://www.gnu.org/licenses/>. */
19
20#ifndef GCC_DIAGNOSTICS_CONTEXT_OPTIONS_H
21#define GCC_DIAGNOSTICS_CONTEXT_OPTIONS_H
22
23/* An enum for controlling what units to use for the column number
24 when diagnostics are output, used by the -fdiagnostics-column-unit option.
25 Tabs will be expanded or not according to the value of -ftabstop. The origin
26 (default 1) is controlled by -fdiagnostics-column-origin. */
27
29{
30 /* The default from GCC 11 onwards: display columns. */
32
33 /* The behavior in GCC 10 and earlier: simple bytes. */
35};
36
37/* An enum for controlling how to print non-ASCII characters/bytes when
38 a diagnostic suggests escaping the source code on output. */
39
41{
42 /* Escape non-ASCII Unicode characters in the form <U+XXXX> and
43 non-UTF-8 bytes in the form <XX>. */
45
46 /* Escape non-ASCII bytes in the form <XX> (thus showing the underlying
47 encoding of non-ASCII Unicode characters). */
49};
50
51/* Enum for overriding the standard output format. */
52
54{
55 /* The default: textual output. */
57
58 /* SARIF-based output, as JSON to stderr. */
60
61 /* SARIF-based output, to a JSON file. */
63};
64
65/* An enum for controlling how diagnostic paths should be printed. */
67{
68 /* Don't print diagnostic paths. */
70
71 /* Print diagnostic paths by emitting a separate "note" for every event
72 in the path. */
74
75 /* Print diagnostic paths by consolidating events together where they
76 are close enough, and printing such runs of events with multiple
77 calls to diagnostic_show_locus, showing the individual events in
78 each run via labels in the source. */
80};
81
82/* An enum for capturing values of GCC_EXTRA_DIAGNOSTIC_OUTPUT,
83 and for -fdiagnostics-parseable-fixits. */
84
86{
87 /* No extra output, or an unrecognized value. */
89
90 /* Emit fix-it hints using the "fixits-v1" format, equivalent to
91 -fdiagnostics-parseable-fixits. */
93
94 /* Emit fix-it hints using the "fixits-v2" format. */
96};
97
98/* Values for -fdiagnostics-text-art-charset=. */
99
101{
102 /* No text art diagrams shall be emitted. */
104
105 /* Use pure ASCII for text art diagrams. */
107
108 /* Use ASCII + conservative use of other unicode characters
109 in text art diagrams. */
111
112 /* Use Emoji. */
114};
115
116#endif /* ! GCC_DIAGNOSTICS_CONTEXT_OPTIONS_H */
diagnostics_escape_format
Definition context-options.h:41
@ DIAGNOSTICS_ESCAPE_FORMAT_BYTES
Definition context-options.h:48
@ DIAGNOSTICS_ESCAPE_FORMAT_UNICODE
Definition context-options.h:44
diagnostic_text_art_charset
Definition context-options.h:101
@ DIAGNOSTICS_TEXT_ART_CHARSET_ASCII
Definition context-options.h:106
@ DIAGNOSTICS_TEXT_ART_CHARSET_NONE
Definition context-options.h:103
@ DIAGNOSTICS_TEXT_ART_CHARSET_UNICODE
Definition context-options.h:110
@ DIAGNOSTICS_TEXT_ART_CHARSET_EMOJI
Definition context-options.h:113
diagnostic_path_format
Definition context-options.h:67
@ DPF_NONE
Definition context-options.h:69
@ DPF_SEPARATE_EVENTS
Definition context-options.h:73
@ DPF_INLINE_EVENTS
Definition context-options.h:79
diagnostics_extra_output_kind
Definition context-options.h:86
@ EXTRA_DIAGNOSTIC_OUTPUT_none
Definition context-options.h:88
@ EXTRA_DIAGNOSTIC_OUTPUT_fixits_v2
Definition context-options.h:95
@ EXTRA_DIAGNOSTIC_OUTPUT_fixits_v1
Definition context-options.h:92
diagnostics_output_format
Definition context-options.h:54
@ DIAGNOSTICS_OUTPUT_FORMAT_SARIF_FILE
Definition context-options.h:62
@ DIAGNOSTICS_OUTPUT_FORMAT_TEXT
Definition context-options.h:56
@ DIAGNOSTICS_OUTPUT_FORMAT_SARIF_STDERR
Definition context-options.h:59
diagnostics_column_unit
Definition context-options.h:29
@ DIAGNOSTICS_COLUMN_UNIT_BYTE
Definition context-options.h:34
@ DIAGNOSTICS_COLUMN_UNIT_DISPLAY
Definition context-options.h:31