On 5/25/21 2:59 AM, Eric Botcazou wrote:
[PATCH 2/11] use xxx_no_warning APIs in Ada.
Looks good to me, but remove the useless pair of parentheses in the 3rd hunk.
The hunk was actually incorrect, thanks for drawing my attention
to it! The second argument to the function is the option. To
suppress all warnings it should have been:
diff --git a/gcc/ada/gcc-interface/utils.c b/gcc/ada/gcc-interface/utils.c
index 1786fbf8186..f2a6f44da76 100644
--- a/gcc/ada/gcc-interface/utils.c
+++ b/gcc/ada/gcc-interface/utils.c
@@ -836,7 +836,7 @@ gnat_pushdecl (tree decl, Node_Id gnat_node)
if (!deferred_decl_context)
DECL_CONTEXT (decl) = context;
- TREE_NO_WARNING (decl) = (No (gnat_node) || Warnings_Off (gnat_node));
+ set_no_warning (decl, -1, No (gnat_node) || Warnings_Off (gnat_node));
/* Set the location of DECL and emit a declaration for it. */
if (Present (gnat_node) && !renaming_from_instantiation_p (gnat_node))
This mistake will be caught when I change the functions to take
enum opt_code instead of int as David suggested.
Martin