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=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!gandalf.srv.welterde.de!news.jacob-sparre.dk!loke.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: GNAT and user-defined aspects and pragmas? Date: Thu, 12 Nov 2015 13:24:26 -0600 Organization: JSA Research & Innovation Message-ID: References: <87h9ku2dcp.fsf@adaheads.sparre-andersen.dk> <87d1vg3mvm.fsf@adaheads.sparre-andersen.dk> NNTP-Posting-Host: rrsoftware.com X-Trace: loke.gir.dk 1447356267 6353 24.196.82.226 (12 Nov 2015 19:24:27 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Thu, 12 Nov 2015 19:24:27 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Xref: news.eternal-september.org comp.lang.ada:28329 Date: 2015-11-12T13:24:26-06:00 List-Id: "Jacob Sparre Andersen" wrote in message news:87d1vg3mvm.fsf@adaheads.sparre-andersen.dk... ... >> Between the two, one gets the impression that if one uses aspects >> beyond those defined by the language reference -- ie; using >> implementation defined aspects -- one accepts that the result is not >> portable. > > That's not the impression I've got from comments from ARG members here > on comp.lang.ada. It is my impression that aspects should be open for > experimentation like pragmas have been, and that aspects are equivalent > to pragmas which are attached to a specific declaration. Certain ARG members are highly confused. :-) Nothing that is an aspect ever should have been a pragma, and aspects should be considered a replacement for pragmas rather than some sort of parallel syntax. Ignoring an aspect is illegal as it is considered to be a critical part of the semantics of the program. Note that this follows the model for attributes and representation clauses. Ignoring unknown pragmas is a mistake in many instances (as Robert Dewar pointed out on several occasions). He gave examples like a pragma that sets up interrupts for some processor. That program might compile on some other implementation, but it won't work. It's better to comment out unknown pragmas and aspects rather than to ignore them. Ada 83 got this wrong for pragmas (although one can find counter-examples where it's helpful). > With your interpretation, we wouldn't be able to compile SPARK 2014 > programs with anything but GNAT - even when some of AdaCore's > competitors release an Ada 2012 compiler. Definitely. Since the SPARK aspects include some additional syntax, I can't see any way that it would be possible for a compiler that doesn't know about SPARK (say Janus/Ada) to compile a SPARK program. To the extent that SPARK annotations aren't significant to the semantics of the program, they probably should have been pragmas. But since AdaCore doesn't understand/believe in the difference, you'll have to remove them. That should be easy with a tool (it's a simple syntax transformation). [Of course, someone has to write the tool.] Randy.