GCC Middle and Back End API Reference
libgdiagnostics.h
Go to the documentation of this file.
1/* A pure C API for emitting diagnostics.
2 Copyright (C) 2023-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
7under the terms of the GNU General Public License as published by
8the Free Software Foundation; either version 3, or (at your option)
9any later version.
10
11GCC is distributed in the hope that it will be useful, but
12WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14General Public License for 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 LIBGDIAGNOSTICS_H
21#define LIBGDIAGNOSTICS_H
22
23#include <stdarg.h>
24#include <stdio.h>
25
26#ifdef __cplusplus
27extern "C" {
28#endif /* __cplusplus */
29
30/**********************************************************************
31 Compatibility macros.
32 **********************************************************************/
33
34/* This macro simplifies testing whether we are using gcc, and if it
35 is of a particular minimum version. (Both major & minor numbers are
36 significant.) This macro will evaluate to 0 if we are not using
37 gcc at all. */
38#define LIBGDIAGNOSTICS_GCC_VERSION (__GNUC__ * 1000 + __GNUC_MINOR__)
39
40/**********************************************************************
41 Macros for attributes.
42 **********************************************************************/
43
44# if (LIBGDIAGNOSTICS_GCC_VERSION >= 3003)
45# define LIBGDIAGNOSTICS_PARAM_MUST_BE_NON_NULL(ARG_NUM) __attribute__ ((__nonnull__ (ARG_NUM)))
46# else
47# define LIBGDIAGNOSTICS_PARAM_MUST_BE_NON_NULL(ARG_NUM)
48# endif /* GNUC >= 3.3 */
49
50#define LIBGDIAGNOSTICS_PARAM_CAN_BE_NULL(ARG_NUM)
51 /* empty; for the human reader */
52
53#define LIBGDIAGNOSTICS_PARAM_GCC_FORMAT_STRING(FMT_ARG_NUM, ARGS_ARG_NUM) \
54 LIBGDIAGNOSTICS_PARAM_MUST_BE_NON_NULL (FMT_ARG_NUM)
55 /* In theory we'd also add
56 __attribute__ ((__format__ (__gcc_diag__, FMT_ARG_NUM, ARGS_ARG_NUM)))
57 if LIBGDIAGNOSTICS_GCC_VERSION >= 4001
58 However, doing so leads to warnings from -Wformat-diag, which is part
59 of -Wall but undocumented, and much fussier than I'd want to inflict
60 on users of libgdiagnostics. */
61
62/**********************************************************************
63 Data structures and types.
64 All structs within the API are opaque.
65 **********************************************************************/
66
67/* An opaque bundle of state for a client of the library.
68 Has zero of more "sinks" to which diagnostics are emitted.
69 Responsibilities:
70 - location-management
71 - caching of source file content
72 - patch generation. */
74
75/* Types relating to diagnostic output sinks. */
76
78
79/* An enum for determining if we should colorize a text output sink. */
86
87/* An enum for choosing the SARIF version for a SARIF output sink. */
88
94
95/* Types relating to "physical" source locations i.e. locations within
96 specific files expressed via line/column. */
97
98/* Opaque type describing a particular input file. */
100
101/* Opaque type representing a key into a database of source locations within
102 a diagnostic_manager. Locations are created by various API calls into
103 the diagnostic_manager expressing source code points and ranges. They
104 persist until the diagnostic_manager is released, which cleans them
105 up.
106
107 NULL means "UNKNOWN", and can be returned by the manager as a
108 fallback when a problem occurs (e.g. too many locations).
109
110 A diagnostic_location can be a single point within the source code,
111 such as here (at the the '"' at the start of the string literal):
112
113 | int i = "foo";
114 | ^
115
116 or be a range with a start and finish, and a "caret" location.
117
118 | a = (foo && bar)
119 | ~~~~~^~~~~~~
120
121 where the caret here is at the first "&", and the start and finish
122 are at the parentheses. */
123
125
126/* Types for storing line and column information in text files.
127
128 Both libgdiagnostics and emacs number source *lines* starting at 1, but
129 they have differing conventions for *columns*.
130
131 libgdiagnostics uses a 1-based convention for source columns,
132 whereas Emacs's M-x column-number-mode uses a 0-based convention.
133
134 For example, an error in the initial, left-hand
135 column of source line 3 is reported by libgdiagnostics as:
136
137 some-file.c:3:1: error: ...etc...
138
139 On navigating to the location of that error in Emacs
140 (e.g. via "next-error"),
141 the locus is reported in the Mode Line
142 (assuming M-x column-number-mode) as:
143
144 some-file.c 10% (3, 0)
145
146 i.e. "3:1:" in libgdiagnostics corresponds to "(3, 0)" in Emacs. */
147
148typedef unsigned int diagnostic_line_num_t;
149typedef unsigned int diagnostic_column_num_t;
150
151/* An opaque type describing a "logical" source location
152 e.g. "within function 'foo'". */
153
155
156/* An enum for discriminating between different kinds of logical location
157 for a diagnostic.
158
159 Roughly corresponds to logicalLocation's "kind" property in SARIF v2.1.0
160 (section 3.33.7). */
161
189
190/* A "diagnostic" is an opaque bundle of state for a particular
191 diagnostic that is being constructed in memory.
192
193 A diagnostic has a primary location and zero or more secondary
194 locations. For example:
195
196 | a = (foo && bar)
197 | ~~~~~^~~~~~~
198
199 This diagnostic has a single diagnostic_location, with the caret
200 at the first "&", and the start/finish at the parentheses.
201
202 Contrast with:
203
204 | a = (foo && bar)
205 | ~~~ ^~ ~~~
206
207 This diagnostic has three locations
208 - The primary location (at "&&") has its caret and start location at
209 the first "&" and end at the second "&.
210 - The secondary location for "foo" has its start and finish at the "f"
211 and "o" of "foo"; the caret is not flagged for display, but is perhaps at
212 the "f" of "foo".
213 - Similarly, the other secondary location (for "bar") has its start and
214 finish at the "b" and "r" of "bar"; the caret is not flagged for
215 display, but is perhaps at the"b" of "bar". */
216typedef struct diagnostic diagnostic;
217
219{
223
224 /* A problem where the input is valid, but the tool isn't
225 able to handle it. */
227};
228
229/* Types for working with execution paths. */
232
233/**********************************************************************
234 API entrypoints.
235 **********************************************************************/
236
237/* Create a new diagnostic_manager.
238 The client needs to call diagnostic_release_manager on it at some
239 point.
240 Note that no output sinks are created by default. */
241
242extern diagnostic_manager *
244
245/* Release a diagnostic_manager.
246 This will flush output to all of the output sinks, and clean up. */
247
248extern void
251
252/* Optional metadata about the manager. */
253
254/* Set a string suitable for use as the value of the SARIF "name" property
255 (SARIF v2.1.0 section 3.19.8). */
256
257extern void
259 const char *value)
262
263/* Set a string suitable for use as the value of the SARIF "fullName" property
264 (SARIF v2.1.0 section 3.19.9). */
265
266extern void
268 const char *value)
271
272/* Set a string suitable for use as the value of the SARIF "version" property
273 (SARIF v2.1.0 section 3.19.13). */
274
275extern void
277 const char *value)
280
281/* Set a string suitable for use as the value of the SARIF "informationUri"
282 property (SARIF v2.1.0 section 3.19.17). */
283
284extern void
286 const char *value)
289
290/* Destinations for diagnostics. */
291
292/* Add a new output sink to DIAG_MGR, which writes GCC-style diagnostics
293 to DST_STREAM.
294 Return a borrowed pointer to the sink, which is cleaned up when DIAG_MGR
295 is released.
296 DST_STREAM is borrowed, and must outlive DIAG_MGR.
297 The output for each diagnostic is written and flushed as each
298 diagnostic is finished. */
299
302 FILE *dst_stream,
303 enum diagnostic_colorize colorize)
306
307/* Functions to manipulate text sinks. */
308
309/* Enable/disable printing of source text in the text sink.
310 Default: enabled. */
311
312extern void
314 int value)
316
317/* Update colorization of text sink. */
318
319extern void
321 enum diagnostic_colorize colorize)
323
324/* Enable/disable colorization of the characters of source text
325 that are underlined.
326 This should be true for clients that generate range information
327 (so that the ranges of code are colorized),
328 and false for clients that merely specify points within the
329 source code (to avoid e.g. colorizing just the first character in
330 a token, which would look strange).
331 Default: enabled. */
332
333extern void
335 int value)
337
338/* Add a new output sink to DIAG_MGR, which writes SARIF of the given
339 version to DST_STREAM.
340
341 The output is not written until DIAG_MGR is released.
342
343 DST_STREAM is borrowed, and must outlive DIAG_MGR.
344
345 For the result to be a valid SARIF file according to the schema,
346 DIAG_MGR must have had diagnostic_manager_set_tool_name called on it. */
347
348extern void
350 FILE *dst_stream,
351 const diagnostic_file *main_input_file,
352 enum diagnostic_sarif_version version)
356
357/* Write a patch to DST_STREAM consisting of all fix-it hints
358 on all diagnostics that have been finished on DIAG_MGR. */
359
360extern void
362 FILE *dst_stream)
365
366/* Location management. */
367
368/* Create a new diagnostic_file * for file NAME.
369
370 Repeated calls with matching NAMEs will return the
371 same object.
372
373 If SARIF_SOURCE_LANGUAGE is non-NULL, it specifies a "sourceLanguage"
374 value for the file when use when writing SARIF.
375 See SARIF v2.1.0 Appendix J for suggested values for various
376 programmming languages. */
377
378extern diagnostic_file *
380 const char *name,
381 const char *sarif_source_language)
385
386/* Populate the source-quoting cache for FILE, specifying the
387 given buffer as the content of the file (rather than
388 attempting to read the content from the filesystem). */
389
390extern void
392 const char *buf,
393 size_t sz)
396
397/* Write a representation of FILE to OUT, for debugging. */
398
399extern void
401 const diagnostic_file *file,
402 FILE *out)
406
407/* Attempt to create a diagnostic_location representing
408 FILENAME:LINE_NUM, with no column information
409 (thus "the whole line"). */
410
411extern const diagnostic_physical_location *
413 const diagnostic_file *file,
414 diagnostic_line_num_t line_num)
417
418/* Attempt to create a diagnostic_physical_location representing
419 FILENAME:LINE_NUM:COLUMN_NUM. */
420
421extern const diagnostic_physical_location *
423 const diagnostic_file *file,
424 diagnostic_line_num_t line_num,
425 diagnostic_column_num_t column_num)
428
429/* Attempt to create a diagnostic_physical_location representing a
430 range within a source file, with a highlighted "caret" location.
431
432 All must be within the same file, but they can be on different lines.
433
434 For example, consider the location of the binary expression below:
435
436 ...|__________1111111112222222
437 ...|12345678901234567890123456
438 ...|
439 521|int sum (int foo, int bar)
440 522|{
441 523| return foo + bar;
442 ...| ~~~~^~~~~
443 524|}
444
445 The location's caret is at the "+", line 523 column 15, but starts
446 earlier, at the "f" of "foo" at column 11. The finish is at the "r"
447 of "bar" at column 19. */
448
449extern const diagnostic_physical_location *
451 const diagnostic_physical_location *loc_caret,
452 const diagnostic_physical_location *loc_start,
453 const diagnostic_physical_location *loc_end)
458
459/* Write a representation of LOC to OUT, for debugging. */
460
461extern void
464 FILE *out)
468
469/* A bundle of state describing a logical location in the user's source,
470 such as "in function 'foo'".
471
472 SHORT_NAME can be NULL, or else a string suitable for use by
473 the SARIF logicalLocation "name" property (SARIF v2.1.0 section 3.33.4).
474
475 FULLY_QUALIFIED_NAME can be NULL or else a string suitable for use by
476 the SARIF logicalLocation "fullyQualifiedName" property
477 (SARIF v2.1.0 section 3.33.5).
478
479 DECORATED_NAME can be NULL or else a string suitable for use by
480 the SARIF logicalLocation "decoratedName" property
481 (SARIF v2.1.0 section 3.33.6). */
482
483extern const diagnostic_logical_location *
486 const diagnostic_logical_location *parent,
487 const char *short_name,
488 const char *fully_qualified_name,
489 const char *decorated_name)
495
496/* Write a representation of LOC to OUT, for debugging. */
497
498extern void
501 FILE *out)
505
506/* Accessors for logical locations (added in LIBGDIAGNOSTICS_ABI_1;
507 you can test for their presence using
508 #ifdef LIBDIAGNOSTICS_HAVE_LOGICAL_LOCATION_ACCESSORS
509*/
510#define LIBDIAGNOSTICS_HAVE_LOGICAL_LOCATION_ACCESSORS
511
515
516extern const diagnostic_logical_location *
519
520extern const char *
523
524extern const char *
527
528extern const char *
531
532/* Diagnostic groups. */
533
534/* Begin a diagnostic group. All diagnostics emitted within
535 DIAG_MGR after the first one will be treated as notes about
536 the initial diagnostic. */
537
538extern void
541
542/* Finish a diagnostic group. */
543
544extern void
547
548/* Step-by-step creation of a diagnostic. */
549
550extern diagnostic *
552 enum diagnostic_level level)
554
555/* Associate this diagnostic with the given ID within
556 the Common Weakness Enumeration. */
557
558extern void
560 unsigned cwe_id)
562
563/* Associate this diagnostic with a particular rule that has been violated
564 (such as in a coding standard, or within a specification).
565 The rule must have at least one of a title and a URL, but these
566 can be NULL.
567 A diagnostic can be associated with zero or more rules. */
568
569extern void
571 const char *title,
572 const char *url)
576
577/* Set the primary location of DIAG. */
578
579extern void
584
585/* Set the primary location of DIAG, with a label. */
586
587extern void
590 const char *fmt, ...)
594
595/* Add a secondary location to DIAG. */
596
597extern void
601
602/* Add a secondary location to DIAG, with a label. */
603
604extern void
607 const char *text)
611
612/* Set the logical location of DIAG. */
613
614extern void
616 const diagnostic_logical_location *logical_loc)
619
620/* Fix-it hints. */
621
622extern void
625 const char *addition)
629
630extern void
633 const char *addition)
637
638extern void
641 const char *replacement)
645
646extern void
651
652/* Create and borrow a pointer to an execution path for DIAG.
653 The path is automatically cleaned up when DIAG is finished. */
654
658
659/* Create a new execution path.
660 This is owned by the called and must have either
661 diagnostic_take_execution_path or diagnostic_execution_path_release
662 called on it. */
663
667
668/* Set DIAG to use PATH as its execution path, taking ownership of PATH. */
669
670extern void
675
676/* Release ownership of PATH, which must not have been taken
677 by a diagnostic. */
678
679extern void
682
683/* Append an event to the end of PATH. */
684
687 const diagnostic_physical_location *physical_loc,
688 const diagnostic_logical_location *logical_loc,
689 unsigned stack_depth,
690 const char *fmt, ...)
696
697/* Append an event to the end of PATH. */
698
701 const diagnostic_physical_location *physical_loc,
702 const diagnostic_logical_location *logical_loc,
703 unsigned stack_depth,
704 const char *fmt,
705 va_list *args)
711
712/* Emit DIAG to all sinks of its manager, and release DIAG.
713 Use FMT for the message.
714 Note that this uses gcc's pretty-print format, which is *not* printf.
715 TODO: who is responsible for putting FMT through gettext? */
716
717extern void
718diagnostic_finish (diagnostic *diag, const char *fmt, ...)
722
723/* As diagnostic_finish, but with a va_list. */
724
725extern void
726diagnostic_finish_va (diagnostic *diag, const char *fmt, va_list *args)
730
731/* Get the diagnostic_file associated with PHYSICAL_LOC. */
732
733extern diagnostic_file *
736
737/* DEFERRED:
738 - thread-safety
739 - plural forms
740 - enum about what a "column number" means (bytes, unichars, etc)
741 - locations within binary files
742 - options and URLs for warnings
743 - enable/disable of warnings by kind
744 - plugin metadata. */
745
746#ifdef __cplusplus
747}
748#endif /* __cplusplus */
749
750#endif /* LIBGDIAGNOSTICS_H */
static struct path_prefix cpath path
Definition collect2.cc:514
void diagnostic_finish(diagnostic_context *context)
Definition diagnostic.h:1161
void diagnostic_manager_set_full_name(diagnostic_manager *diag_mgr, const char *value)
Definition libgdiagnostics.cc:1295
diagnostic_text_sink * diagnostic_manager_add_text_sink(diagnostic_manager *diag_mgr, FILE *dst_stream, enum diagnostic_colorize colorize)
Definition libgdiagnostics.cc:1331
const diagnostic_logical_location * diagnostic_manager_new_logical_location(diagnostic_manager *diag_mgr, enum diagnostic_logical_location_kind_t kind, const diagnostic_logical_location *parent, const char *short_name, const char *fully_qualified_name, const char *decorated_name)
Definition libgdiagnostics.cc:1548
void diagnostic_add_location(diagnostic *diag, const diagnostic_physical_location *loc)
Definition libgdiagnostics.cc:1726
void diagnostic_add_fix_it_hint_delete(diagnostic *diag, const diagnostic_physical_location *loc)
Definition libgdiagnostics.cc:1811
void diagnostic_manager_write_patch(diagnostic_manager *diag_mgr, FILE *dst_stream)
Definition libgdiagnostics.cc:1414
diagnostic_event_id diagnostic_execution_path_add_event(diagnostic_execution_path *path, const diagnostic_physical_location *physical_loc, const diagnostic_logical_location *logical_loc, unsigned stack_depth, const char *gmsgid,...)
Definition libgdiagnostics.cc:1864
void diagnostic_manager_add_sarif_sink(diagnostic_manager *diag_mgr, FILE *dst_stream, const diagnostic_file *main_input_file, enum diagnostic_sarif_version version)
Definition libgdiagnostics.cc:1381
void diagnostic_text_sink_set_labelled_source_colorization_enabled(diagnostic_text_sink *text_sink, int value)
Definition libgdiagnostics.cc:1369
const diagnostic_physical_location * diagnostic_manager_new_location_from_range(diagnostic_manager *diag_mgr, const diagnostic_physical_location *loc_caret, const diagnostic_physical_location *loc_start, const diagnostic_physical_location *loc_end)
Definition libgdiagnostics.cc:1503
void diagnostic_text_sink_set_colorize(diagnostic_text_sink *text_sink, enum diagnostic_colorize colorize)
Definition libgdiagnostics.cc:1358
diagnostic_execution_path * diagnostic_add_execution_path(diagnostic *diag)
Definition libgdiagnostics.cc:1824
void diagnostic_set_location(diagnostic *diag, const diagnostic_physical_location *loc)
Definition libgdiagnostics.cc:1714
void diagnostic_add_fix_it_hint_insert_before(diagnostic *diag, const diagnostic_physical_location *loc, const char *addition)
Definition libgdiagnostics.cc:1763
void diagnostic_manager_debug_dump_logical_location(const diagnostic_manager *diag_mgr, const diagnostic_logical_location *loc, FILE *out)
Definition libgdiagnostics.cc:1565
diagnostic_event_id diagnostic_execution_path_add_event_va(diagnostic_execution_path *path, const diagnostic_physical_location *physical_loc, const diagnostic_logical_location *logical_loc, unsigned stack_depth, const char *gmsgid, va_list *args)
Definition libgdiagnostics.cc:1887
diagnostic_file * diagnostic_physical_location_get_file(const diagnostic_physical_location *physical_loc)
Definition libgdiagnostics.cc:1937
const diagnostic_physical_location * diagnostic_manager_new_location_from_file_line_column(diagnostic_manager *diag_mgr, const diagnostic_file *file, diagnostic_line_num_t line_num, diagnostic_column_num_t column_num)
Definition libgdiagnostics.cc:1487
void diagnostic_manager_set_version_url(diagnostic_manager *diag_mgr, const char *value)
Definition libgdiagnostics.cc:1319
void diagnostic_file_set_buffered_content(diagnostic_file *file, const char *buf, size_t sz)
Definition libgdiagnostics.cc:1439
void diagnostic_set_logical_location(diagnostic *diag, const diagnostic_logical_location *logical_loc)
Definition libgdiagnostics.cc:1752
void diagnostic_add_fix_it_hint_replace(diagnostic *diag, const diagnostic_physical_location *loc, const char *replacement)
Definition libgdiagnostics.cc:1795
void diagnostic_manager_debug_dump_location(const diagnostic_manager *diag_mgr, const diagnostic_physical_location *loc, FILE *out)
Definition libgdiagnostics.cc:1518
void diagnostic_manager_set_version_string(diagnostic_manager *diag_mgr, const char *value)
Definition libgdiagnostics.cc:1307
void diagnostic_add_location_with_label(diagnostic *diag, const diagnostic_physical_location *loc, const char *text)
Definition libgdiagnostics.cc:1738
diagnostic_file * diagnostic_manager_new_file(diagnostic_manager *diag_mgr, const char *name, const char *sarif_source_language)
Definition libgdiagnostics.cc:1426
void diagnostic_finish_va(diagnostic *diag, const char *gmsgid, va_list *args)
Definition libgdiagnostics.cc:1920
void diagnostic_execution_path_release(diagnostic_execution_path *path)
Definition libgdiagnostics.cc:1856
void diagnostic_add_fix_it_hint_insert_after(diagnostic *diag, const diagnostic_physical_location *loc, const char *addition)
Definition libgdiagnostics.cc:1779
void diagnostic_manager_debug_dump_file(diagnostic_manager *, const diagnostic_file *file, FILE *out)
Definition libgdiagnostics.cc:1450
void diagnostic_text_sink_set_source_printing_enabled(diagnostic_text_sink *text_sink, int value)
Definition libgdiagnostics.cc:1347
const diagnostic_physical_location * diagnostic_manager_new_location_from_file_and_line(diagnostic_manager *diag_mgr, const diagnostic_file *file, diagnostic_line_num_t linenum)
Definition libgdiagnostics.cc:1474
diagnostic_execution_path * diagnostic_manager_new_execution_path(diagnostic_manager *manager)
Definition libgdiagnostics.cc:1834
void diagnostic_take_execution_path(diagnostic *diag, diagnostic_execution_path *path)
Definition libgdiagnostics.cc:1844
void diagnostic_set_location_with_label(diagnostic *diag, const diagnostic_physical_location *loc, const char *fmt,...) LIBGDIAGNOSTICS_PARAM_MUST_BE_NON_NULL(3)
#define LIBGDIAGNOSTICS_PARAM_CAN_BE_NULL(ARG_NUM)
Definition libgdiagnostics.h:50
void diagnostic_add_rule(diagnostic *diag, const char *title, const char *url) LIBGDIAGNOSTICS_PARAM_CAN_BE_NULL(3)
Definition libgdiagnostics.cc:1702
diagnostic * diagnostic_begin(diagnostic_manager *diag_mgr, enum diagnostic_level level) LIBGDIAGNOSTICS_PARAM_MUST_BE_NON_NULL(1)
Definition libgdiagnostics.cc:1680
int diagnostic_event_id
Definition libgdiagnostics.h:231
#define LIBGDIAGNOSTICS_PARAM_GCC_FORMAT_STRING(FMT_ARG_NUM, ARGS_ARG_NUM)
Definition libgdiagnostics.h:53
void diagnostic_manager_end_group(diagnostic_manager *diag_mgr) LIBGDIAGNOSTICS_PARAM_MUST_BE_NON_NULL(1)
Definition libgdiagnostics.cc:1671
#define LIBGDIAGNOSTICS_PARAM_MUST_BE_NON_NULL(ARG_NUM)
Definition libgdiagnostics.h:47
diagnostic_logical_location_kind_t
Definition libgdiagnostics.h:163
@ DIAGNOSTIC_LOGICAL_LOCATION_KIND_FUNCTION
Definition libgdiagnostics.h:165
@ DIAGNOSTIC_LOGICAL_LOCATION_KIND_DECLARATION
Definition libgdiagnostics.h:181
@ DIAGNOSTIC_LOGICAL_LOCATION_KIND_NAMESPACE
Definition libgdiagnostics.h:168
@ DIAGNOSTIC_LOGICAL_LOCATION_KIND_ATTRIBUTE
Definition libgdiagnostics.h:176
@ DIAGNOSTIC_LOGICAL_LOCATION_KIND_ARRAY
Definition libgdiagnostics.h:185
@ DIAGNOSTIC_LOGICAL_LOCATION_KIND_VALUE
Definition libgdiagnostics.h:187
@ DIAGNOSTIC_LOGICAL_LOCATION_KIND_MEMBER
Definition libgdiagnostics.h:166
@ DIAGNOSTIC_LOGICAL_LOCATION_KIND_PROCESSING_INSTRUCTION
Definition libgdiagnostics.h:179
@ DIAGNOSTIC_LOGICAL_LOCATION_KIND_OBJECT
Definition libgdiagnostics.h:184
@ DIAGNOSTIC_LOGICAL_LOCATION_KIND_RETURN_TYPE
Definition libgdiagnostics.h:170
@ DIAGNOSTIC_LOGICAL_LOCATION_KIND_TEXT
Definition libgdiagnostics.h:177
@ DIAGNOSTIC_LOGICAL_LOCATION_KIND_VARIABLE
Definition libgdiagnostics.h:172
@ DIAGNOSTIC_LOGICAL_LOCATION_KIND_TYPE
Definition libgdiagnostics.h:169
@ DIAGNOSTIC_LOGICAL_LOCATION_KIND_ELEMENT
Definition libgdiagnostics.h:175
@ DIAGNOSTIC_LOGICAL_LOCATION_KIND_PARAMETER
Definition libgdiagnostics.h:171
@ DIAGNOSTIC_LOGICAL_LOCATION_KIND_MODULE
Definition libgdiagnostics.h:167
@ DIAGNOSTIC_LOGICAL_LOCATION_KIND_PROPERTY
Definition libgdiagnostics.h:186
@ DIAGNOSTIC_LOGICAL_LOCATION_KIND_COMMENT
Definition libgdiagnostics.h:178
@ DIAGNOSTIC_LOGICAL_LOCATION_KIND_DTD
Definition libgdiagnostics.h:180
unsigned int diagnostic_line_num_t
Definition libgdiagnostics.h:148
void diagnostic_set_cwe(diagnostic *diag, unsigned cwe_id) LIBGDIAGNOSTICS_PARAM_MUST_BE_NON_NULL(1)
Definition libgdiagnostics.cc:1691
void diagnostic_manager_set_tool_name(diagnostic_manager *diag_mgr, const char *value) LIBGDIAGNOSTICS_PARAM_MUST_BE_NON_NULL(2)
Definition libgdiagnostics.cc:1283
diagnostic_manager * diagnostic_manager_new(void)
Definition libgdiagnostics.cc:1267
diagnostic_sarif_version
Definition libgdiagnostics.h:90
@ DIAGNOSTIC_SARIF_VERSION_2_1_0
Definition libgdiagnostics.h:91
@ DIAGNOSTIC_SARIF_VERSION_2_2_PRERELEASE
Definition libgdiagnostics.h:92
diagnostic_colorize
Definition libgdiagnostics.h:81
@ DIAGNOSTIC_COLORIZE_YES
Definition libgdiagnostics.h:84
@ DIAGNOSTIC_COLORIZE_IF_TTY
Definition libgdiagnostics.h:82
@ DIAGNOSTIC_COLORIZE_NO
Definition libgdiagnostics.h:83
const char * diagnostic_logical_location_get_short_name(const diagnostic_logical_location *loc) LIBGDIAGNOSTICS_PARAM_MUST_BE_NON_NULL(1)
Definition libgdiagnostics.cc:1964
unsigned int diagnostic_column_num_t
Definition libgdiagnostics.h:149
diagnostic_level
Definition libgdiagnostics.h:219
@ DIAGNOSTIC_LEVEL_ERROR
Definition libgdiagnostics.h:220
@ DIAGNOSTIC_LEVEL_SORRY
Definition libgdiagnostics.h:226
@ DIAGNOSTIC_LEVEL_WARNING
Definition libgdiagnostics.h:221
@ DIAGNOSTIC_LEVEL_NOTE
Definition libgdiagnostics.h:222
void diagnostic_manager_begin_group(diagnostic_manager *diag_mgr) LIBGDIAGNOSTICS_PARAM_MUST_BE_NON_NULL(1)
Definition libgdiagnostics.cc:1662
enum diagnostic_logical_location_kind_t diagnostic_logical_location_get_kind(const diagnostic_logical_location *loc) LIBGDIAGNOSTICS_PARAM_MUST_BE_NON_NULL(1)
Definition libgdiagnostics.cc:1948
void diagnostic_manager_release(diagnostic_manager *) LIBGDIAGNOSTICS_PARAM_MUST_BE_NON_NULL(1)
Definition libgdiagnostics.cc:1275
const char * diagnostic_logical_location_get_fully_qualified_name(const diagnostic_logical_location *loc) LIBGDIAGNOSTICS_PARAM_MUST_BE_NON_NULL(1)
Definition libgdiagnostics.cc:1972
const diagnostic_logical_location * diagnostic_logical_location_get_parent(const diagnostic_logical_location *loc) LIBGDIAGNOSTICS_PARAM_MUST_BE_NON_NULL(1)
Definition libgdiagnostics.cc:1956
const char * diagnostic_logical_location_get_decorated_name(const diagnostic_logical_location *loc) LIBGDIAGNOSTICS_PARAM_MUST_BE_NON_NULL(1)
Definition libgdiagnostics.cc:1980
Definition libgdiagnostics.cc:846
Definition libgdiagnostics.cc:109
Definition libgdiagnostics.cc:166
Definition libgdiagnostics.cc:430
Definition libgdiagnostics.cc:142
Definition libgdiagnostics.cc:221
Definition libgdiagnostics.cc:907
Definition reload.cc:154