diff options
author | Martin Sebor <msebor@redhat.com> | 2021-06-24 15:35:20 -0600 |
---|---|---|
committer | Martin Sebor <msebor@redhat.com> | 2021-06-24 19:23:43 -0600 |
commit | 1ebd2b2c9407796cd526137038b9b885f68ffb4d (patch) | |
tree | 3cad29c233769e764d045ba8383bcd16df07bb04 /gcc/tree.h | |
parent | 7036e9ef462fde8181bece4ac4e03f3aa27204dc (diff) | |
download | gcc-1ebd2b2c9407796cd526137038b9b885f68ffb4d.zip gcc-1ebd2b2c9407796cd526137038b9b885f68ffb4d.tar.gz gcc-1ebd2b2c9407796cd526137038b9b885f68ffb4d.tar.bz2 |
c: add support for per-location warning groups.
gcc/ChangeLog:
* tree.h (warning_suppressed_at, copy_warning,
warning_suppressed_p, suppress_warning): New functions.
gcc/c/ChangeLog:
* c-decl.c (pop_scope): Replace direct uses of TREE_NO_WARNING with
warning_suppressed_p, suppress_warning, and copy_no_warning.
(diagnose_mismatched_decls): Same.
(duplicate_decls): Same.
(grokdeclarator): Same.
(finish_function): Same.
(c_write_global_declarations_1): Same.
* c-fold.c (c_fully_fold_internal): Same.
* c-parser.c (c_parser_expr_no_commas): Same.
(c_parser_postfix_expression): Same.
* c-typeck.c (array_to_pointer_conversion): Same.
(function_to_pointer_conversion): Same.
(default_function_array_conversion): Same.
(convert_lvalue_to_rvalue): Same.
(default_conversion): Same.
(build_indirect_ref): Same.
(build_function_call_vec): Same.
(build_atomic_assign): Same.
(build_unary_op): Same.
(c_finish_return): Same.
(emit_side_effect_warnings): Same.
(c_finish_stmt_expr): Same.
(c_omp_clause_copy_ctor): Same.
Diffstat (limited to 'gcc/tree.h')
-rw-r--r-- | gcc/tree.h | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -6448,9 +6448,24 @@ constexpr opt_code no_warning = opt_code (); /* Wildcard code that refers to all warnings. */ constexpr opt_code all_warnings = N_OPTS; +/* Return the disposition for a warning (or all warnings by default) + at a location. */ +extern bool warning_suppressed_at (location_t, opt_code = all_warnings); /* Set the disposition for a warning (or all warnings by default) at a location to disabled by default. */ extern bool suppress_warning_at (location_t, opt_code = all_warnings, bool = true); +/* Copy warning disposition from one location to another. */ +extern void copy_warning (location_t, location_t); + +/* Return the disposition for a warning (or all warnings by default) + for an expression. */ +extern bool warning_suppressed_p (const_tree, opt_code = all_warnings); +/* Set the disposition for a warning (or all warnings by default) + at a location to disabled by default. */ +extern void suppress_warning (tree, opt_code = all_warnings, bool = true) + ATTRIBUTE_NONNULL (1); +/* Copy warning disposition from one expression to another. */ +extern void copy_warning (tree, const_tree); #endif /* GCC_TREE_H */ |