comp.lang.ada
 help / color / mirror / Atom feed
From: "Jeffrey R. Carter" <spam.jrcarter.not@spam.not.acm.org>
Subject: Re: CONSTRAINT ERROR: erroneous memory access
Date: Sun, 7 Jun 2020 10:51:44 +0200
Date: 2020-06-07T10:51:44+02:00	[thread overview]
Message-ID: <rbi9r1$fuc$1@dont-email.me> (raw)
In-Reply-To: <d0ff83ad-a216-4fd6-b0ff-ef51a7c27d48o@googlegroups.com>

On 6/7/20 1:40 AM, jcupak@gmail.com wrote:
> It has been a few years since I have written Ada; I used and taught Ada 95 back when I was working for a defense contractor. But, now that I'm retired, I wanted to get up to speed with Ada 2012, so I decided to implement a main program to see how the Shortest_Paths generic package works (taken from A.18.31, pages 574-576). But, when I read in the data and call the Shortest_Path function, it returns with CONSTRAINT ERROR: erroneous memory access. I've tried multiple times, but can't seem to figure out what I'm doing (or NOT doing) wrong.

Actually ARM A.18.32: 
http://www.ada-auth.org/standards/rm12_w_tc1/html/RM-A-18-32.html

Since you're using Ada 12, you must be using GNAT. With its default options, 
GNAT is not an Ada compiler. You need to add -gnatan -fstack-check to obtain 
full Ada semantics. (Technically, you also need -gnatE, but that doesn't affect 
the behavior of a properly elaborated program.) With those options, I suspect 
you'll get Storage_Error, which might be easier to understand.

-- 
Jeff Carter
"How'd you like to hide the egg and gurgitate
a few saucers of mocha java?"
Never Give a Sucker an Even Break
101

  parent reply	other threads:[~2020-06-07  8:51 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-06 23:40 CONSTRAINT ERROR: erroneous memory access jcupak
2020-06-07  8:00 ` Egil H H
2020-06-09  0:39   ` CONSTRAINT ERROR: erroneous memory access - SOLVED John Cupak
2020-06-09 10:07     ` AdaMagica
2020-06-07  8:51 ` Jeffrey R. Carter [this message]
2020-06-07 10:20   ` CONSTRAINT ERROR: erroneous memory access Simon Wright
2020-06-07 14:47     ` Jeffrey R. Carter
2020-06-07 15:53 ` Anh Vo
2020-06-07 16:17   ` Egil H H
replies disabled

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