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]

[Ada] Remove spurious warning


Tested on i686-linux, committed on mainline.

Fix a spurious warning when using Mod attribute.
The following must compile quietly:

package Q is
   Modulus : constant := 4;
   type S is range 0 .. Modulus - 1; -- S'Last < Modulus
   type M is mod Modulus;
   function F (X : S) return M;
end;

package body Q is
   function F (X : S) return M is
   begin
      return M'Mod (X);
   end;
end;

2005-07-04  Ed Schonberg  <schonberg@adacore.com>

	* exp_attr.adb (Mod): Evaluate condition expression with checks off,
	to prevent spurious warnings.

Attachment: difs.7
Description: Text document


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