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.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no 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!.POSTED!not-for-mail From: "G.B." Newsgroups: comp.lang.ada Subject: Re: Can .ads be compiled alone? Date: Fri, 07 Nov 2014 17:29:48 +0100 Organization: A noiseless patient Spider Message-ID: References: <520f8f3d-b345-4ef8-ac41-ead78edde92a@googlegroups.com> Reply-To: nonlegitur@futureapps.de Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Fri, 7 Nov 2014 16:29:39 +0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="b96887e80893c84a90c3007226ca0d1c"; logging-data="19213"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18ORi+adZW7TfDUoXX2HApIW3MvQo/o4I0=" User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 In-Reply-To: Cancel-Lock: sha1:2d9A4TKxJ1K3dY9f7Y4pHjIYrwc= Xref: news.eternal-september.org comp.lang.ada:23063 Date: 2014-11-07T17:29:48+01:00 List-Id: On 07.11.14 16:49, Björn Lundin wrote: > On 2014-11-07 15:54, Tero Koskinen wrote: >> 7.11.2014 9:48, Chris Moore wrote: >>> You cannot generate code from a spec. >> >> I think this isn't true anymore for Ada 2012? >> > > It was never true, if the body was not needed > > This should compile and produce an object file > > package Constants is > Bad_Pi : constant Integer := 3; > end Constants; To wit, $ gnatmake -v -gnatl -gnatv -gnatwa constants.ads GNATMAKE GPL 2014 (20140331) Copyright (C) 1992-2014, Free Software Foundation, Inc. "constants.ali" being checked ... -> "constants.ali" missing. gcc -c -gnatl -gnatv -gnatwa constants.ads GNAT GPL 2014 (20140331) Copyright 1992-2014, Free Software Foundation, Inc. Compiling: constants.ads (source file time stamp: 2014-11-07 16:16:35) 1. package Constants is 2. Bad_Pi : constant Integer := 3; 3. end Constants; 3 lines: No errors End of compilation $ ls -l constants.o -rw-r--r-- 1 bauhaus admin 444 7 Nov 17:17 constants.o