This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Impressively difficult to compile code for GNAT
- From: gcc at coreland dot ath dot cx
- To: gcc at gcc dot gnu dot org
- Date: Sat, 21 Nov 2009 16:34:56 +0000
- Subject: Impressively difficult to compile code for GNAT
Hello.
I'm working on a small project to create an abstraction over directories
and archives. I've managed to write some code that seems simple enough
(using tagged limited types) and even though the code appears to be valid,
it seems to either trigger bugs in the runtime (causing crashes on execution)
or fails to compile:
Both Debian GCC 4.3, GNAT GPL 2009 and FreeBSD GCC 4.4 fail with the following:
pfseudo-archiver-directory.adb:24:41: wrong type for return_subtype_indication
pfseudo-archiver-directory.adb:46:35: wrong type for return_subtype_indication
GCC SVN (r154285) fails to build with a strange error:
arc_dir_003.adb:25:32: "_master" conflicts with declaration at line 21
The output of -gnatG shows this error to be apparently incorrect:
error := false;
B_1 : declare
_master : constant integer := system__soft_links__current_master.all;
A6bM : integer renames _master;
type A6b is access all pfseudo__archiver__Tarchive_tC;
R7b : A6b := pfseudo__archiver__directory.
The code is available here:
http://git.coreland.ath.cx/gitweb.cgi?p=pfseudo/.git;a=summary
$ git clone http://git.coreland.ath.cx/pfseudo/.git
Configure and build with:
$ echo 'gcc' > conf-adacomp
$ echo 'gnatbind' > conf-adabind
$ echo 'gnatlink' > conf-adalink
$ make
$ make tests
Regards,
M