comp.lang.ada
 help / color / mirror / Atom feed
From: Egil H H <ehh.public@gmail.com>
Subject: Re: Gnat for ARM : are these bugs?
Date: Tue, 19 May 2015 01:44:16 -0700 (PDT)
Date: 2015-05-19T01:44:16-07:00	[thread overview]
Message-ID: <681ade3b-a203-40bb-a26e-5f77324f644c@googlegroups.com> (raw)
In-Reply-To: <2cfd12ff-e3dc-44c2-a462-aefd3ff5b8c4@googlegroups.com>

On Tuesday, May 19, 2015 at 9:54:32 AM UTC+2, jan.de...@gmail.com wrote:
> 
> 1. its seems to be illegal to to assign 2 ** 0 ( = 1) to a mod type.

Works fine for me (on x86, though).
No expert on ARM-assembly but I read bge as greater or equal, so:
	cmp	r3, #0                         -- if N<0 then exception
	bge	.L2                            -- else .L2

> 
> 2. on a illegal assignment like 2 ** 32 to a 32 bit mod type the answer is a big fat zero with no questions asked.

All operations on modular types are performed modulo the modulus, ** is no exception from that rule.
If you want it to fail, try instead to assign a named number:

   bar : constant := 2**N;
begin
   S := bar;

-- 
~egilhh


      parent reply	other threads:[~2015-05-19  8:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-19  7:54 Gnat for ARM : are these bugs? jan.de.kruyf
2015-05-19  8:42 ` jan.de.kruyf
2015-05-19  8:44 ` Egil H H [this message]
replies disabled

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