This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH v2] ada: Suppress warning on possibly unused out parameters in UI_Div_Rem
- From: Arnaud Charlet <charlet at adacore dot com>
- To: Samuel Tardieu <sam at rfc1149 dot net>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Sun, 28 Oct 2007 14:07:49 +0100
- Subject: Re: [PATCH v2] ada: Suppress warning on possibly unused out parameters in UI_Div_Rem
- References: <20071028124516.D1D16C405C@mail2.rfc1149.net>
> Arnaud, here is the new patch for PR ada/33929 with embedded comments.
The comment is slightly misleading, since it's not GNAT but GCC that
is generating this warning (the middle-end), and the comment should also make
it clear that the warning is bogus in this case.
I'd suggest something like:
-- As designed, this procedure may leave Quotient or Remainder untouched
-- if Discard_Quotient or Discard_Remainder is True. GCC may emit a
-- misleading warning about possible use of these variables
-- uninitialized which cannot happen here, so we disable these warnings
-- using pragma Warnings (Off, xxx) which disconnects also GCC warnings.
And would also change the ChangeLog:
* uintp.adb (UI_Div_Rem): Supress warnings on Quotient and
Remainder generated by GCC.
Since the warning is not about 'not updating the variable', it's about a
possible use uninitialized in UI_Div_Rem itself:
trunk/gcc/ada/uintp.adb:171: warning: 'Quotient' may be used uninitialized in this function
OK with these changes.