-- Volatile is handled by the same circuit as Atomic_Components
+ ----------------------
+ -- Warning_As_Error --
+ ----------------------
+
+ when Pragma_Warning_As_Error =>
+ GNAT_Pragma;
+ Check_Arg_Count (1);
+ Check_No_Identifiers;
+ Check_Valid_Configuration_Pragma;
+
+ if not Is_Static_String_Expression (Arg1) then
+ Error_Pragma_Arg
+ ("argument of pragma% must be static string expression",
+ Arg1);
+
+ -- OK static string expression
+
+ else
+ String_To_Name_Buffer
+ (Strval (Expr_Value_S (Get_Pragma_Arg (Arg1))));
+ Warnings_As_Errors_Count := Warnings_As_Errors_Count + 1;
+ Warnings_As_Errors (Warnings_As_Errors_Count) :=
+ new String'(Name_Buffer (1 .. Name_Len));
+ end if;
+
--------------
-- Warnings --
--------------
end loop;
end if;
- -- Error if not entity or static string literal case
+ -- Error if not entity or static string expression case
elsif not Is_Static_String_Expression (Arg2) then
Error_Pragma_Arg
("second argument of pragma% must be entity name "
& "or static string expression", Arg2);
- -- String literal case
+ -- Static string expression case
else
String_To_Name_Buffer
Pragma_Validity_Checks => -1,
Pragma_Volatile => 0,
Pragma_Volatile_Components => 0,
+ Pragma_Warning_As_Error => -1,
Pragma_Warnings => -1,
Pragma_Weak_External => -1,
Pragma_Wide_Character_Encoding => 0,