comp.lang.ada
 help / color / mirror / Atom feed
* New compiler error with new compiler
@ 2022-12-06 11:13 Jerry
  2022-12-06 11:36 ` Dmitry A. Kazakov
  2022-12-08 20:37 ` Simon Wright
  0 siblings, 2 replies; 8+ messages in thread
From: Jerry @ 2022-12-06 11:13 UTC (permalink / raw)


As mentioned in a recent post, I changed from a 2015 GNAT on Mac Intel to 2022 compiler on Mac ARM.

I don't know if this is of interest but I am now getting a compiler error that I never got before. It is in the Ada bindings to MPFR https://www.mpfr.org/. The problematic code is in this SVN checkout that I have never laid eyes on but which worked well in the past, certainly without compiler errors.

The error that I am now getting is 

mpfr-floats.adb:788:27: error: duplication of choice value: 15 at line 787

Here are lines around the referenced lines from that file. The first line (function...) is numbered 783.

   function Generic_Round (X : MPFR_Float) return F
   is begin
      case F'Base'Digits is
      when Float'Digits           => return F(mpfr_get_flt(X.Value, default_rounding_mode));
      when Long_Float'Digits      => return F(mpfr_get_d  (X.Value, default_rounding_mode));
      when Long_Long_Float'Digits => return F(mpfr_get_ld (X.Value, default_rounding_mode));
      when others                 => raise Constraint_Error;
      end case;
   end Generic_Round;

When I comment out line 788 the error does not appear. I have not used this binding for a long time and have not tested it today so I don't know the effect of this modification. The file is several years old and I don't know if the current code base for the bindings is the same--my concern here is the new Ada compiler complaint.

Jerry

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-12-08 20:37 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-06 11:13 New compiler error with new compiler Jerry
2022-12-06 11:36 ` Dmitry A. Kazakov
2022-12-06 13:32   ` Simon Wright
2022-12-08  4:07     ` Jerry
2022-12-08  8:15       ` Dmitry A. Kazakov
2022-12-08 10:29       ` Jeffrey R.Carter
2022-12-08 20:30       ` G.B.
2022-12-08 20:37 ` Simon Wright

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox