20#ifndef LIBGDIAGNOSTICS_H
21#define LIBGDIAGNOSTICS_H
38#define LIBGDIAGNOSTICS_GCC_VERSION (__GNUC__ * 1000 + __GNUC_MINOR__)
44# if (LIBGDIAGNOSTICS_GCC_VERSION >= 3003)
45# define LIBGDIAGNOSTICS_PARAM_MUST_BE_NON_NULL(ARG_NUM) __attribute__ ((__nonnull__ (ARG_NUM)))
47# define LIBGDIAGNOSTICS_PARAM_MUST_BE_NON_NULL(ARG_NUM)
50#define LIBGDIAGNOSTICS_PARAM_CAN_BE_NULL(ARG_NUM)
53#define LIBGDIAGNOSTICS_PARAM_GCC_FORMAT_STRING(FMT_ARG_NUM, ARGS_ARG_NUM) \
54 LIBGDIAGNOSTICS_PARAM_MUST_BE_NON_NULL (FMT_ARG_NUM)
365 const
char *sarif_source_language)
471 const
char *short_name,
472 const
char *fully_qualified_name,
473 const
char *decorated_name)
548 const
char *fmt, ...)
583 const
char *addition)
591 const
char *addition)
647 unsigned stack_depth,
648 const
char *fmt, ...)
661 unsigned stack_depth,
void diagnostic_manager_set_version_string(diagnostic_manager *diag_mgr, const char *value) LIBGDIAGNOSTICS_PARAM_MUST_BE_NON_NULL(2)
Definition libgdiagnostics.cc:1169
void diagnostic_text_sink_set_colorize(diagnostic_text_sink *text_sink, enum diagnostic_colorize colorize) LIBGDIAGNOSTICS_PARAM_MUST_BE_NON_NULL(1)
Definition libgdiagnostics.cc:1220
void diagnostic_add_fix_it_hint_insert_before(diagnostic *diag, const diagnostic_physical_location *loc, const char *addition) LIBGDIAGNOSTICS_PARAM_MUST_BE_NON_NULL(3)
Definition libgdiagnostics.cc:1586
void diagnostic_set_logical_location(diagnostic *diag, const diagnostic_logical_location *logical_loc) LIBGDIAGNOSTICS_PARAM_CAN_BE_NULL(2)
Definition libgdiagnostics.cc:1575
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:1525
diagnostic_execution_path * diagnostic_manager_new_execution_path(diagnostic_manager *manager) LIBGDIAGNOSTICS_PARAM_MUST_BE_NON_NULL(1)
Definition libgdiagnostics.cc:1657
diagnostic * diagnostic_begin(diagnostic_manager *diag_mgr, enum diagnostic_level level) LIBGDIAGNOSTICS_PARAM_MUST_BE_NON_NULL(1)
Definition libgdiagnostics.cc:1503
diagnostic_execution_path * diagnostic_add_execution_path(diagnostic *diag) LIBGDIAGNOSTICS_PARAM_MUST_BE_NON_NULL(1)
Definition libgdiagnostics.cc:1647
int diagnostic_event_id
Definition libgdiagnostics.h:215
#define LIBGDIAGNOSTICS_PARAM_GCC_FORMAT_STRING(FMT_ARG_NUM, ARGS_ARG_NUM)
Definition libgdiagnostics.h:53
void diagnostic_manager_set_version_url(diagnostic_manager *diag_mgr, const char *value) LIBGDIAGNOSTICS_PARAM_MUST_BE_NON_NULL(2)
Definition libgdiagnostics.cc:1181
void diagnostic_manager_end_group(diagnostic_manager *diag_mgr) LIBGDIAGNOSTICS_PARAM_MUST_BE_NON_NULL(1)
Definition libgdiagnostics.cc:1494
diagnostic_text_sink * diagnostic_manager_add_text_sink(diagnostic_manager *diag_mgr, FILE *dst_stream, enum diagnostic_colorize colorize) LIBGDIAGNOSTICS_PARAM_MUST_BE_NON_NULL(2)
Definition libgdiagnostics.cc:1193
#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:164
@ DIAGNOSTIC_LOGICAL_LOCATION_KIND_NAMESPACE
Definition libgdiagnostics.h:167
@ DIAGNOSTIC_LOGICAL_LOCATION_KIND_MEMBER
Definition libgdiagnostics.h:165
@ DIAGNOSTIC_LOGICAL_LOCATION_KIND_RETURN_TYPE
Definition libgdiagnostics.h:169
@ DIAGNOSTIC_LOGICAL_LOCATION_KIND_VARIABLE
Definition libgdiagnostics.h:171
@ DIAGNOSTIC_LOGICAL_LOCATION_KIND_TYPE
Definition libgdiagnostics.h:168
@ DIAGNOSTIC_LOGICAL_LOCATION_KIND_PARAMETER
Definition libgdiagnostics.h:170
@ DIAGNOSTIC_LOGICAL_LOCATION_KIND_MODULE
Definition libgdiagnostics.h:166
unsigned int diagnostic_line_num_t
Definition libgdiagnostics.h:148
void diagnostic_add_location(diagnostic *diag, const diagnostic_physical_location *loc) LIBGDIAGNOSTICS_PARAM_MUST_BE_NON_NULL(1)
Definition libgdiagnostics.cc:1549
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 *fmt,...) LIBGDIAGNOSTICS_PARAM_GCC_FORMAT_STRING(5
void diagnostic_add_fix_it_hint_insert_after(diagnostic *diag, const diagnostic_physical_location *loc, const char *addition) LIBGDIAGNOSTICS_PARAM_MUST_BE_NON_NULL(3)
Definition libgdiagnostics.cc:1602
void diagnostic_set_cwe(diagnostic *diag, unsigned cwe_id) LIBGDIAGNOSTICS_PARAM_MUST_BE_NON_NULL(1)
Definition libgdiagnostics.cc:1514
const diagnostic_physical_location * diagnostic_manager_new_location_from_file_and_line(diagnostic_manager *diag_mgr, const diagnostic_file *file, diagnostic_line_num_t line_num) LIBGDIAGNOSTICS_PARAM_MUST_BE_NON_NULL(2)
Definition libgdiagnostics.cc:1336
void diagnostic_manager_set_tool_name(diagnostic_manager *diag_mgr, const char *value) LIBGDIAGNOSTICS_PARAM_MUST_BE_NON_NULL(2)
Definition libgdiagnostics.cc:1145
diagnostic_manager * diagnostic_manager_new(void)
Definition libgdiagnostics.cc:1129
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_event_id diagnostic_event_id void void diagnostic_finish_va(diagnostic *diag, const char *fmt, va_list *args) LIBGDIAGNOSTICS_PARAM_GCC_FORMAT_STRING(2
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 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) LIBGDIAGNOSTICS_PARAM_CAN_BE_NULL(6)
Definition libgdiagnostics.cc:1410
diagnostic_file * diagnostic_manager_new_file(diagnostic_manager *diag_mgr, const char *name, const char *sarif_source_language) LIBGDIAGNOSTICS_PARAM_CAN_BE_NULL(3)
Definition libgdiagnostics.cc:1288
void diagnostic_add_location_with_label(diagnostic *diag, const diagnostic_physical_location *loc, const char *text) LIBGDIAGNOSTICS_PARAM_MUST_BE_NON_NULL(3)
Definition libgdiagnostics.cc:1561
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) LIBGDIAGNOSTICS_PARAM_MUST_BE_NON_NULL(2)
Definition libgdiagnostics.cc:1349
void diagnostic_manager_set_full_name(diagnostic_manager *diag_mgr, const char *value) LIBGDIAGNOSTICS_PARAM_MUST_BE_NON_NULL(2)
Definition libgdiagnostics.cc:1157
void diagnostic_manager_debug_dump_location(const diagnostic_manager *diag_mgr, const diagnostic_physical_location *loc, FILE *out) LIBGDIAGNOSTICS_PARAM_MUST_BE_NON_NULL(3)
Definition libgdiagnostics.cc:1380
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) LIBGDIAGNOSTICS_PARAM_CAN_BE_NULL(4)
Definition libgdiagnostics.cc:1365
unsigned int diagnostic_column_num_t
Definition libgdiagnostics.h:149
void diagnostic_add_fix_it_hint_delete(diagnostic *diag, const diagnostic_physical_location *loc) LIBGDIAGNOSTICS_PARAM_CAN_BE_NULL(2)
Definition libgdiagnostics.cc:1634
void diagnostic_manager_add_sarif_sink(diagnostic_manager *diag_mgr, FILE *dst_stream, const diagnostic_file *main_input_file, enum diagnostic_sarif_version version) LIBGDIAGNOSTICS_PARAM_MUST_BE_NON_NULL(3)
Definition libgdiagnostics.cc:1243
void diagnostic_text_sink_set_labelled_source_colorization_enabled(diagnostic_text_sink *text_sink, int value) LIBGDIAGNOSTICS_PARAM_MUST_BE_NON_NULL(1)
Definition libgdiagnostics.cc:1231
diagnostic_level
Definition libgdiagnostics.h:203
@ DIAGNOSTIC_LEVEL_ERROR
Definition libgdiagnostics.h:204
@ DIAGNOSTIC_LEVEL_SORRY
Definition libgdiagnostics.h:210
@ DIAGNOSTIC_LEVEL_WARNING
Definition libgdiagnostics.h:205
@ DIAGNOSTIC_LEVEL_NOTE
Definition libgdiagnostics.h:206
void diagnostic_manager_write_patch(diagnostic_manager *diag_mgr, FILE *dst_stream) LIBGDIAGNOSTICS_PARAM_MUST_BE_NON_NULL(2)
Definition libgdiagnostics.cc:1276
void diagnostic_manager_begin_group(diagnostic_manager *diag_mgr) LIBGDIAGNOSTICS_PARAM_MUST_BE_NON_NULL(1)
Definition libgdiagnostics.cc:1485
void diagnostic_execution_path_release(diagnostic_execution_path *path) LIBGDIAGNOSTICS_PARAM_CAN_BE_NULL(1)
Definition libgdiagnostics.cc:1679
diagnostic_event_id diagnostic_event_id void diagnostic_finish(diagnostic *diag, const char *fmt,...) LIBGDIAGNOSTICS_PARAM_GCC_FORMAT_STRING(2
void diagnostic_manager_release(diagnostic_manager *) LIBGDIAGNOSTICS_PARAM_MUST_BE_NON_NULL(1)
Definition libgdiagnostics.cc:1137
void diagnostic_manager_debug_dump_logical_location(const diagnostic_manager *diag_mgr, const diagnostic_logical_location *loc, FILE *out) LIBGDIAGNOSTICS_PARAM_MUST_BE_NON_NULL(3)
Definition libgdiagnostics.cc:1427
void diagnostic_text_sink_set_source_printing_enabled(diagnostic_text_sink *text_sink, int value) LIBGDIAGNOSTICS_PARAM_MUST_BE_NON_NULL(1)
Definition libgdiagnostics.cc:1209
void diagnostic_file_set_buffered_content(diagnostic_file *file, const char *buf, size_t sz) LIBGDIAGNOSTICS_PARAM_MUST_BE_NON_NULL(2)
Definition libgdiagnostics.cc:1301
void diagnostic_take_execution_path(diagnostic *diag, diagnostic_execution_path *path) LIBGDIAGNOSTICS_PARAM_MUST_BE_NON_NULL(2)
Definition libgdiagnostics.cc:1667
void diagnostic_add_fix_it_hint_replace(diagnostic *diag, const diagnostic_physical_location *loc, const char *replacement) LIBGDIAGNOSTICS_PARAM_MUST_BE_NON_NULL(3)
Definition libgdiagnostics.cc:1618
void diagnostic_set_location(diagnostic *diag, const diagnostic_physical_location *loc) LIBGDIAGNOSTICS_PARAM_CAN_BE_NULL(2)
Definition libgdiagnostics.cc:1537
void diagnostic_manager_debug_dump_file(diagnostic_manager *diag_mgr, const diagnostic_file *file, FILE *out) LIBGDIAGNOSTICS_PARAM_MUST_BE_NON_NULL(3)
Definition libgdiagnostics.cc:1312
diagnostic_event_id 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 *fmt, va_list *args) LIBGDIAGNOSTICS_PARAM_GCC_FORMAT_STRING(5
Definition libgdiagnostics.cc:765
Definition libgdiagnostics.cc:110
Definition libgdiagnostics.cc:165
Definition libgdiagnostics.cc:365
Definition libgdiagnostics.cc:143
Definition libgdiagnostics.cc:270
Definition libgdiagnostics.cc:824