[PATCH v2] ada: Suppress warning on possibly unused out parameters in UI_Div_Rem
Samuel Tardieu
sam@rfc1149.net
Sun Oct 28 13:03:00 GMT 2007
Arnaud, here is the new patch for PR ada/33929 with embedded comments.
2007-10-28 Samuel Tardieu <sam@rfc1149.net>
PR ada/33929
* uintp.adb (UI_Div_Rem): Supress warnings on Quotient and
Remainder as they may not be updated depending on the
Discard_Quotient and Discard_Remainder settings.
---
gcc/ada/uintp.adb | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/gcc/ada/uintp.adb b/gcc/ada/uintp.adb
index 4ee886e..ce5a508 100644
--- a/gcc/ada/uintp.adb
+++ b/gcc/ada/uintp.adb
@@ -1280,6 +1280,14 @@ package body Uintp is
Discard_Quotient : Boolean;
Discard_Remainder : Boolean)
is
+ -- This procedure may leave Quotient or Remainder untouched if
+ -- Discard_Quotient or Discard_Remainder is True. When compiling
+ -- it, GNAT will notice that those out formals are not necessarily
+ -- modified and will issue a warning unless instructed not to do so.
+
+ pragma Warnings (Off, Quotient);
+ pragma Warnings (Off, Remainder);
+
begin
pragma Assert (Right /= Uint_0);
--
1.5.3.4
More information about the Gcc-patches
mailing list