From: Per Sandberg <per.s.sandberg@bahnhof.se>
Subject: Re: Hint to Ada newbies
Date: Thu, 9 Feb 2017 07:06:26 +0100
Date: 2017-02-09T07:06:26+01:00 [thread overview]
Message-ID: <DFTmA.290841$8w1.131571@fx02.fr7> (raw)
In-Reply-To: <a1dfb7fc-1cca-4d6b-abf2-8b2acb3e3215@googlegroups.com>
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
>
next prev parent reply other threads:[~2017-02-09 6:06 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-09 4:17 Hint to Ada newbies reinkor
2017-02-09 6:06 ` Per Sandberg [this message]
2017-02-09 8:02 ` Simon Wright
2017-02-09 23:12 ` Robert A Duff
2017-02-10 9:22 ` Dmitry A. Kazakov
2017-02-11 9:16 ` Hadrien Grasland
2017-02-11 9:39 ` Dmitry A. Kazakov
2017-02-10 9:56 ` Simon Wright
2017-02-11 9:25 ` Hadrien Grasland
2017-02-09 9:26 ` reinkor
2017-02-09 17:40 ` John Smith
2017-02-11 17:40 ` stevenselectronicmail
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox