Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

"Oh what wouldn't I give to be spat at in the face..." -- a prisoner in "Life of Brian"


devel / comp.lang.ada / New compiler error with new compiler

SubjectAuthor
* New compiler error with new compilerJerry
+* Re: New compiler error with new compilerDmitry A. Kazakov
|`* Re: New compiler error with new compilerSimon Wright
| `* Re: New compiler error with new compilerJerry
|  +- Re: New compiler error with new compilerDmitry A. Kazakov
|  +- Re: New compiler error with new compilerJeffrey R.Carter
|  `- Re: New compiler error with new compilerG.B.
`- Re: New compiler error with new compilerSimon Wright

1
New compiler error with new compiler

<dc9f378b-d21b-48a1-b28c-c47e64eea9bcn@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=9078&group=comp.lang.ada#9078

  copy link   Newsgroups: comp.lang.ada
X-Received: by 2002:a05:620a:489:b0:6fe:c76e:2ad9 with SMTP id 9-20020a05620a048900b006fec76e2ad9mr4701813qkr.35.1670325229325;
Tue, 06 Dec 2022 03:13:49 -0800 (PST)
X-Received: by 2002:a05:622a:1386:b0:3a6:18ff:c6c1 with SMTP id
o6-20020a05622a138600b003a618ffc6c1mr64497873qtk.683.1670325229081; Tue, 06
Dec 2022 03:13:49 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.ada
Date: Tue, 6 Dec 2022 03:13:48 -0800 (PST)
Injection-Info: google-groups.googlegroups.com; posting-host=184.98.49.135; posting-account=x5rpZwoAAABMN2XPwcebPWPkebpwQNJG
NNTP-Posting-Host: 184.98.49.135
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <dc9f378b-d21b-48a1-b28c-c47e64eea9bcn@googlegroups.com>
Subject: New compiler error with new compiler
From: list_email@icloud.com (Jerry)
Injection-Date: Tue, 06 Dec 2022 11:13:49 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2529
 by: Jerry - Tue, 6 Dec 2022 11:13 UTC

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

Re: New compiler error with new compiler

<tmn9g7$1kq7$1@gioia.aioe.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=9079&group=comp.lang.ada#9079

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!aioe.org!jsz7MSurcLFfjpj9fQtAZA.user.46.165.242.91.POSTED!not-for-mail
From: mailbox@dmitry-kazakov.de (Dmitry A. Kazakov)
Newsgroups: comp.lang.ada
Subject: Re: New compiler error with new compiler
Date: Tue, 6 Dec 2022 12:36:41 +0100
Organization: Aioe.org NNTP Server
Message-ID: <tmn9g7$1kq7$1@gioia.aioe.org>
References: <dc9f378b-d21b-48a1-b28c-c47e64eea9bcn@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="54087"; posting-host="jsz7MSurcLFfjpj9fQtAZA.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.5.1
X-Notice: Filtered by postfilter v. 0.9.2
Content-Language: en-US
 by: Dmitry A. Kazakov - Tue, 6 Dec 2022 11:36 UTC

On 2022-12-06 12:13, Jerry wrote:
> 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 => eturn 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.

Looks like Long_Long_Float has at least same mantissa as Long_Float.
What are the actual values of Long_Float'Digits and Long_Long_Float'Digits?

Anyway it is all permitted:

ARM 3.5.7(16):

"An implementation is allowed to provide additional predefined floating
point types, declared in the visible part of Standard, whose
(unconstrained) first subtypes have names of the form Short_Float,
Long_Float, Short_Short_Float, Long_Long_Float, etc. Different
predefined floating point types are allowed to have the same base
decimal precision. However, the precision of Float should be no greater
than that of Long_Float. Similarly, the precision of Short_Float (if
provided) should be no greater than Float. Corresponding recommendations
apply to any other predefined floating point types. There need not be a
named floating point type corresponding to each distinct base decimal
precision supported by an implementation."

But bindings look very strange to me:

1. Long_Long_Float may not exist at all.
2. When dealing with a C library, use C types defined in Interfaces.C!

--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de

Re: New compiler error with new compiler

<m2359ssln8.fsf@pushface.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=9080&group=comp.lang.ada#9080

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!aioe.org!XkhLYGh9FeaGRJtDGav81g.user.46.165.242.75.POSTED!not-for-mail
From: simon@pushface.org (Simon Wright)
Newsgroups: comp.lang.ada
Subject: Re: New compiler error with new compiler
Date: Tue, 06 Dec 2022 13:32:27 +0000
Organization: Aioe.org NNTP Server
Message-ID: <m2359ssln8.fsf@pushface.org>
References: <dc9f378b-d21b-48a1-b28c-c47e64eea9bcn@googlegroups.com>
<tmn9g7$1kq7$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: gioia.aioe.org; logging-data="30066"; posting-host="XkhLYGh9FeaGRJtDGav81g.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (darwin)
X-Notice: Filtered by postfilter v. 0.9.2
Cancel-Lock: sha1:c2LiyKf/QtFCblbahLE+50oKoPk=
 by: Simon Wright - Tue, 6 Dec 2022 13:32 UTC

"Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> writes:

> Looks like Long_Long_Float has at least same mantissa as
> Long_Float. What are the actual values of Long_Float'Digits and
> Long_Long_Float'Digits?

You can get a listing of package Standard by compiling with -gnatS.

On aarch64, with the aarch64 compiler,

type Short_Float is digits 6
range -16#0.FFFF_FF#E32 .. 16#0.FFFF_FF#E32;
for Short_Float'Size use 32;

type Float is digits 6
range -16#0.FFFF_FF#E32 .. 16#0.FFFF_FF#E32;
for Float'Size use 32;

type Long_Float is digits 15
range -16#0.FFFF_FFFF_FFFF_F8#E256 .. 16#0.FFFF_FFFF_FFFF_F8#E256;
for Long_Float'Size use 64;

type Long_Long_Float is digits 15
range -16#0.FFFF_FFFF_FFFF_F8#E256 .. 16#0.FFFF_FFFF_FFFF_F8#E256;
for Long_Long_Float'Size use 64;

With the x86_64 compiler,

type Short_Float is digits 6
range -16#0.FFFF_FF#E32 .. 16#0.FFFF_FF#E32;
for Short_Float'Size use 32;

type Float is digits 6
range -16#0.FFFF_FF#E32 .. 16#0.FFFF_FF#E32;
for Float'Size use 32;

type Long_Float is digits 15
range -16#0.FFFF_FFFF_FFFF_F8#E256 .. 16#0.FFFF_FFFF_FFFF_F8#E256;
for Long_Float'Size use 64;

type Long_Long_Float is digits 18
range -16#0.FFFF_FFFF_FFFF_FFFF#E4096 .. 16#0.FFFF_FFFF_FFFF_FFFF#E4096;
for Long_Long_Float'Size use 128;

Don't forget that on aarch64, x86_64 code is 'emulated' by Rosetta.

Re: New compiler error with new compiler

<cd12eaed-0b85-4d1f-a1f6-e88d40dc00bdn@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=9082&group=comp.lang.ada#9082

  copy link   Newsgroups: comp.lang.ada
X-Received: by 2002:a05:6214:882:b0:4bb:7998:fed6 with SMTP id cz2-20020a056214088200b004bb7998fed6mr84932185qvb.86.1670472427877;
Wed, 07 Dec 2022 20:07:07 -0800 (PST)
X-Received: by 2002:a05:620a:13d7:b0:6fb:57cb:47ce with SMTP id
g23-20020a05620a13d700b006fb57cb47cemr68575613qkl.452.1670472427729; Wed, 07
Dec 2022 20:07:07 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.ada
Date: Wed, 7 Dec 2022 20:07:07 -0800 (PST)
In-Reply-To: <m2359ssln8.fsf@pushface.org>
Injection-Info: google-groups.googlegroups.com; posting-host=184.98.49.135; posting-account=x5rpZwoAAABMN2XPwcebPWPkebpwQNJG
NNTP-Posting-Host: 184.98.49.135
References: <dc9f378b-d21b-48a1-b28c-c47e64eea9bcn@googlegroups.com>
<tmn9g7$1kq7$1@gioia.aioe.org> <m2359ssln8.fsf@pushface.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <cd12eaed-0b85-4d1f-a1f6-e88d40dc00bdn@googlegroups.com>
Subject: Re: New compiler error with new compiler
From: list_email@icloud.com (Jerry)
Injection-Date: Thu, 08 Dec 2022 04:07:07 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1256
 by: Jerry - Thu, 8 Dec 2022 04:07 UTC

So the correctness of an Ada program can depend on the processor that it runs on?

Jerry

Re: New compiler error with new compiler

<tms6e5$8d6$1@gioia.aioe.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=9083&group=comp.lang.ada#9083

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!aioe.org!hzzNxxMX5IPvnEV4b74Cww.user.46.165.242.91.POSTED!not-for-mail
From: mailbox@dmitry-kazakov.de (Dmitry A. Kazakov)
Newsgroups: comp.lang.ada
Subject: Re: New compiler error with new compiler
Date: Thu, 8 Dec 2022 09:15:00 +0100
Organization: Aioe.org NNTP Server
Message-ID: <tms6e5$8d6$1@gioia.aioe.org>
References: <dc9f378b-d21b-48a1-b28c-c47e64eea9bcn@googlegroups.com>
<tmn9g7$1kq7$1@gioia.aioe.org> <m2359ssln8.fsf@pushface.org>
<cd12eaed-0b85-4d1f-a1f6-e88d40dc00bdn@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="8614"; posting-host="hzzNxxMX5IPvnEV4b74Cww.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.5.1
X-Notice: Filtered by postfilter v. 0.9.2
Content-Language: en-US
 by: Dmitry A. Kazakov - Thu, 8 Dec 2022 08:15 UTC

On 2022-12-08 05:07, Jerry wrote:
> So the correctness of an Ada program can depend on the processor that it runs on?

If you make legality of your program dependent on the attribute of
*machine* types what else do you expect?

(The program, you presented, is IMO poorly written and incorrect)

--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de

Re: New compiler error with new compiler

<tmsea9$rjnr$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=9084&group=comp.lang.ada#9084

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: spam.jrcarter.not@spam.acm.org.not (Jeffrey R.Carter)
Newsgroups: comp.lang.ada
Subject: Re: New compiler error with new compiler
Date: Thu, 8 Dec 2022 11:29:29 +0100
Organization: A noiseless patient Spider
Lines: 14
Message-ID: <tmsea9$rjnr$1@dont-email.me>
References: <dc9f378b-d21b-48a1-b28c-c47e64eea9bcn@googlegroups.com>
<tmn9g7$1kq7$1@gioia.aioe.org> <m2359ssln8.fsf@pushface.org>
<cd12eaed-0b85-4d1f-a1f6-e88d40dc00bdn@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 8 Dec 2022 10:29:29 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="f398e66b28be6f914ccc9a196fbec34d";
logging-data="904955"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18qqkLV/yFJsxxm4ZOxjH271UMm+y0t9DQ="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.4.2
Cancel-Lock: sha1:nXO7MJMqDuEuSxoEofVQjJJzTcc=
In-Reply-To: <cd12eaed-0b85-4d1f-a1f6-e88d40dc00bdn@googlegroups.com>
Content-Language: en-US
 by: Jeffrey R.Carter - Thu, 8 Dec 2022 10:29 UTC

On 2022-12-08 05:07, Jerry wrote:
> So the correctness of an Ada program can depend on the processor that it runs on?

The code you presented is compiler-dependent. It cannot be presumed to be
portable to another compiler, or even (as you discovered) to another version of
the same compiler.

--
Jeff Carter
“[T]here are lots of people out there writing software
that should really be out cleaning toilets instead.”
Brian Catlin
173

Re: New compiler error with new compiler

<tmthgl$ud3k$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=9089&group=comp.lang.ada#9089

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: bauhaus@notmyhomepage.invalid (G.B.)
Newsgroups: comp.lang.ada
Subject: Re: New compiler error with new compiler
Date: Thu, 8 Dec 2022 21:30:12 +0100
Organization: A noiseless patient Spider
Lines: 25
Message-ID: <tmthgl$ud3k$1@dont-email.me>
References: <dc9f378b-d21b-48a1-b28c-c47e64eea9bcn@googlegroups.com>
<tmn9g7$1kq7$1@gioia.aioe.org> <m2359ssln8.fsf@pushface.org>
<cd12eaed-0b85-4d1f-a1f6-e88d40dc00bdn@googlegroups.com>
Reply-To: nonlegitur@notmyhomepage.de
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 8 Dec 2022 20:30:13 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="c7a469bf64e4a0526b5b80cbce17c3dc";
logging-data="996468"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18N2/L5njFGyxat4Uo2P0Jw33zXYOnHlVw="
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
Gecko/20100101 Thunderbird/102.5.0
Cancel-Lock: sha1:6n/t2kX5rceAHr6I8MyWgCTO2nE=
In-Reply-To: <cd12eaed-0b85-4d1f-a1f6-e88d40dc00bdn@googlegroups.com>
Content-Language: en-US
 by: G.B. - Thu, 8 Dec 2022 20:30 UTC

On 08.12.22 05:07, Jerry wrote:
> So the correctness of an Ada program can depend on the processor that it runs on?

The correctness of the Ada program will depend
on the correctness of its assumptions ;-)

declare
Freezing_Cold : constant Integer :=
Integer'Last / 1_000;
begin
Put ("Water freezes at ");
Put (Freezing_Cold, Width => 2);
Put (" degrees Fahrenheit");
end;

The case statement of the program shown in your message
features a technique (of the few that are available to
the C programmer) for testing properties of an implementation
of C, at compile time.

Software configuration for the target platform can remove
the need for this kind of case distinction. Source text
will be restricted to normal program logic.

Re: New compiler error with new compiler

<lylenhpr7l.fsf@pushface.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=9090&group=comp.lang.ada#9090

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!aioe.org!XkhLYGh9FeaGRJtDGav81g.user.46.165.242.75.POSTED!not-for-mail
From: simon@pushface.org (Simon Wright)
Newsgroups: comp.lang.ada
Subject: Re: New compiler error with new compiler
Date: Thu, 08 Dec 2022 20:37:18 +0000
Organization: Aioe.org NNTP Server
Message-ID: <lylenhpr7l.fsf@pushface.org>
References: <dc9f378b-d21b-48a1-b28c-c47e64eea9bcn@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: gioia.aioe.org; logging-data="48660"; posting-host="XkhLYGh9FeaGRJtDGav81g.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (darwin)
X-Notice: Filtered by postfilter v. 0.9.2
Cancel-Lock: sha1:vTME7O/MWvKO+FHMbJ+sN6PlAuA=
 by: Simon Wright - Thu, 8 Dec 2022 20:37 UTC

This might be a little more portable if it was written using if .. elsif
... etc


devel / comp.lang.ada / New compiler error with new compiler

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor