This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH v2] ada: Suppress warning on possibly unused out parameters in UI_Div_Rem


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]