From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=0.4 required=5.0 tests=BAYES_00,FORGED_MUA_MOZILLA autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,bdebc54a485c13a4 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.232.169 with SMTP id tp9mr12757860pbc.6.1332547449734; Fri, 23 Mar 2012 17:04:09 -0700 (PDT) Path: kz5ni26103pbc.0!nntp.google.com!news1.google.com!goblin2!goblin.stu.neva.ru!news.teledata-fn.de!newsfeed.arcor.de!newsspool1.arcor-online.net!news.arcor.de.POSTED!not-for-mail Date: Sat, 24 Mar 2012 01:04:08 +0100 From: Georg Bauhaus User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2 MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: My first compiler bug: work around or redesign? References: <10kx1zr05qt9s$.ab8q1peu0ukt.dlg@40tude.net> In-Reply-To: Message-ID: <4f6d0f78$0$6623$9b4e6d93@newsspool2.arcor-online.net> Organization: Arcor NNTP-Posting-Date: 24 Mar 2012 01:04:08 CET NNTP-Posting-Host: 49e8a030.newsspool2.arcor-online.net X-Trace: DXC=]dUcYPh5FA6]E=H1Q9`787A9EHlD;3Yc24Fo<]lROoR18kFejV8jcK0gaYAAN<9Q9e0\XJ:l: X-Complaints-To: usenet-abuse@arcor.de Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Date: 2012-03-24T01:04:08+01:00 List-Id: On 23.03.12 22:40, Natasha Kerensikova wrote: > On 2012-03-23, Robert A Duff wrote: >> "Dmitry A. Kazakov" writes: >> >>> First, make sure your code is legal. In some cases GNAT crashes when >>> detects an error in the program. One method to find the problem is to >>> comment offending source code lines until it compiles and then twist it >>> this or that way. >> >> It's easier to use the -gnatdO switch, which is documented >> in debug.adb. > > I tried compiling my code with that extra flag, and I got exactly the > same error output. > > I don't know really know what conclusion to draw from there. A bug seems present, with or without switches, in GNAT GPL 2011/Mac, too. +===========================GNAT BUG DETECTED==============================+ | GPL 2011 (20110419) (x86_64-apple-darwin10.2.0) GCC error: | | in gnat_to_gnu_entity, at ada/gcc-interface/decl.c:4121 | | Error detected at dressup-parsers-markdown.adb:184:4 [dressup-parsers-markdown.adb:1651:7 [markdown.adb:32:4]]| From the looks of it, it seems there is a probability that the bug is related to passing information between GNAT and other parts of GCC. The rest is speculation by mere mortals :-) I worked around by adding switch -gnat95 and then mechanically following the compiler's complaints. Less than I did might do the trick, though, with GNAT at least, or any compiler that accepts Ada 2005 from the RTS in Ada 95 programs. http://home.arcor.de/bauhaus/Ada/Dressup-bf54531f8dcf7117.diff (A huge fraction of the patch is just syntax.) I have let warnings about Ada.Containers (being 2005) be warnings. The same relaxed attitude might work with GNAT and the new Strings.Fixed, the one with the From parameter. I seem not to have changed the generics part which you have been mentioning. Moreover, I have added generics where procedures such as Iterate require anonymous subprogram pointers now---no fancy downwards closures needed here, though, and simple instantiations would do. The resulting executable bin/markdown does output HTML for *, \n==, etc., but I'm not sure that I have been sufficiently meticulous. (Is bin/markdown supposed to successfully run a test suite yet? I found test cases in something called MarkdownTest_1.0.zip, which has a driver program written in Perl in it. I haven't used it directly, but fed Tests/Tabs.text from this distribution to bin/markdown and compared the results, just to see if I hadn't messed up).