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,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.99.124.91 with SMTP id l27mr1463694pgn.135.1486662059012; Thu, 09 Feb 2017 09:40:59 -0800 (PST) X-Received: by 10.157.8.10 with SMTP id 10mr309231oty.19.1486662058954; Thu, 09 Feb 2017 09:40:58 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!news.glorb.com!r185no587807ita.0!news-out.google.com!78ni1844itm.0!nntp.google.com!r185no587797ita.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Thu, 9 Feb 2017 09:40:58 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=2601:18f:900:f900:453d:87a5:de7c:1786; posting-account=AvekzAoAAABj-TclKcOWQmXwA49MFPGX NNTP-Posting-Host: 2601:18f:900:f900:453d:87a5:de7c:1786 References: User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Hint to Ada newbies From: John Smith Injection-Date: Thu, 09 Feb 2017 17:40:58 +0000 Content-Type: text/plain; charset=UTF-8 Xref: news.eternal-september.org comp.lang.ada:33294 Date: 2017-02-09T09:40:58-08:00 List-Id: Thanks, this is super useful. On Thursday, February 9, 2017 at 1:06:32 AM UTC-5, Per Sandberg wrote: > Som more hints on switches: > > This is a snippet of my usual project file during development. It will > force me to keep a consistent layout and catch a lot of errors during > compile and tests. > > my.gpr: > ------------------------------------ > project My is > > for Source_Dirs use ("src"); > for Object_Dir use ".obj"; > for Main use ("main.adb"); > > package Builder is > for Default_Switches("Ada") use ("-k", "-j0"); > for Global_Configuration_Pragmas use project'Project_Dir & "my.gpp"; > -- Initialize data to bad values. > end Builder; > > package Compiler is > for Switches ("ada") use > ("-gnatyybcfhiklnprtu", "-gnatyN256", "-gnaty3", -- Check > layout. > "-gnatVa", -- Turn on all validity checking options > "-gnatwa", -- Turn most info/Warning > "-gnatwe", -- Treat all warnings as errors > "-gnata", -- Enable Assertions. > "-gnateE", -- Generate extra information in exception > messages > "-gnatQ"); -- Don't quit, write ali/tree file even if compile > errors > end Compiler; > > package Binder is > for Switches ("ada") use > ("-E"); -- Store callstack in exceptions. > end Binder; > end Test_My; > ------------------------------------ > my.gpp > ---------------------------------- > pragma Initialize_Scalars; > -------------------------------- > > /P > > > Den 2017-02-09 kl. 05:17, skrev reinkor: > > Just sharing experience: > > > > I tried gnat compiler option "-gnatwa" and revealed a lot of weakness in my Ada project. It also helped to improve the structure of the code which I have worked on and modified over time. > > > > Just a hint to newbies :-) > > > > https://gcc.gnu.org/onlinedocs/gnat_ugn/Warning-Message-Control.html > > > > reinert > >