This is the mail archive of the 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]

Re: [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.

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:

 	PR ada/33929
 	* 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.


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