On Aug 25, 2008, at 8:18 PM, Alan W. Irwin wrote:

> On 2008-08-25 17:24-0700 Jerry wrote:
>
>> Attached is a zip file with three short Ada files in it. They have  
>> a similar structure to the problematic example 19 but do not call  
>> or link to any PLplot stuff (despite the names of some things  
>> looking PLplot-y).
>>
>> Alan (or someone else with a 64-bit Ada compiler), if you would,  
>> please unzip, cd to the directory, and type
>>
>> gnatmake ./x19a_temp.adb
>>
>> You should see two warnings but no errors. If it compiles...
>
> It does not compile on Linux.  Here is the error message:
>
> [EMAIL PROTECTED]> gnatmake ./x19a_temp.adb
> gcc-4.3 -c -I./ -I- ./x19a_temp.adb
> x19a_temp.adb:2:05: file "type_declaration.ads" not found
> gnatmake: "./x19a_temp.adb" compilation error
>
> There is something strange about how case is interpreted by  
> gnatmake on
> Linux.  Anyhow, I converted everything (file names and symbols  
> inside the
> file) to lower-case type_declaration, and the result compiles.
>
> [EMAIL PROTECTED]> gnatmake x19a_temp.adb
> gcc-4.3 -c x19a_temp.adb
> x19a_temp.adb:10:38: warning: type of argument "mapform19.x" is
> unconstrained array
> x19a_temp.adb:10:38: warning: foreign caller must pass bounds  
> explicitly
> gcc-4.3 -c type_declaration.adb
> gnatbind -x x19a_temp.ali
> gnatlink x19a_temp.ali
>
> I have attached a compressed tarball with the corrected files for  
> this test
> case that compiles on Linux (and hopefully MacOSX as well).
>
> We now have a working simple test case that generates the run-time  
> error (at
> least on my 64-bit box with gnat version 4.3.1-2).
>
> [EMAIL PROTECTED]> ./x19a_temp
>
> raised STORAGE_ERROR : stack overflow (or erroneous memory access)
>
> Jerry, did the compressed tarball attachment survive your ISP? If  
> so does it
> compile and run properly for you?
>
> Alan
>
I got the tarball. It compiles and runs correctly on my machine.

I'm running GNAT 4.3.0.

So what do we do now? I'm inclined to post this example to  
comp.lang.ada but maybe I should just directly figure out how to file  
a bug report. Alan, remind me what OS and hardware you're running.

There might be a way for me to change the 'Unrestricted_Access in  
example 19 to 'Access but it would involve moving the user-defined  
procedure mapform19 into the bindings, an ugly fix. I don't know if  
that would eliminate the run-time error but if it did it would at  
least allow example 19 to exist along with the others until another  
solution is found at the compiler level.

Also, I wonder if the problem is related to the fact that C calling  
conventions are being enforced. Alan, if you want to, you could try  
commenting out those lines--when I do so, it still compiles and runs.  
Anything we learn from this won't help us PLplot-wise since we need  
the C calling convention but it might help the GNAT people if they  
look into this. That would be:

In x19a_temp.adb, comment out, using --:

     procedure mapform19(n : Integer; x : in out Real_Vector);
     pragma Convention(C, mapform19);

In type_declarations.ads, comment out:

     pragma Convention(Convention => C, Entity =>  
Map_Form_Function_Pointer_Type);

Jerry


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel

Reply via email to