comp.lang.ada
 help / color / mirror / Atom feed
From: Jerry <list_email@icloud.com>
Subject: New compiler error with new compiler
Date: Tue, 6 Dec 2022 03:13:48 -0800 (PST)	[thread overview]
Message-ID: <dc9f378b-d21b-48a1-b28c-c47e64eea9bcn@googlegroups.com> (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

             reply	other threads:[~2022-12-06 11:13 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-06 11:13 Jerry [this message]
2022-12-06 11:36 ` New compiler error with new compiler 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
replies disabled

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