comp.lang.ada
 help / color / mirror / Atom feed
From: "Hervé Bitteur" <Herve.Bitteur@France.Sun.COM>
Subject: Re: Specific use of GNAT style checking
Date: Tue, 22 May 2001 10:46:00 +0200
Date: 2001-05-22T08:45:56+00:00	[thread overview]
Message-ID: <3B0A2748.B446554C@France.Sun.COM> (raw)
In-Reply-To: u3d9yplxs.fsf@wanadoo.fr



Pascal Obry wrote:
> 
> Herv� Bitteur <Herve.Bitteur@France.Sun.COM> writes:
> 
> > Hello,
> >
> > I personally like the compiler (GNAT) ability to check the style
> > consistency across a whole bunch of Ada source files. I use flags such
> > as -gnatg to check conformance to GNAT style.
> 
> You should not use -gnatg but -gnaty.
> 
> > However, I also reuse other Ada components for which I have no intention
> > to modify the code, even at just the layout level. But these components
> > may get (re)compiled because of some dependency on my code, for generic
> > instantiation for example.
> 
> Just compile the library (before compiling your code) without the -gnaty
> switch?
> 
> Pascal.


Oops, I meant "-gnaty" instead of "-gnatg", you are right. 
But interestingly enough, the info file of GNAT 3.13p user guide (File:
gnat_ug.info, Node: Switches for gcc) says :

`-gnatg'
     GNAT style checks enabled.

So my confusion, when I wrote my message!

Now, back to my original question. Jean-Pierre suggested to compile the
foreign units beforehand in a separate library. Fine, but this does not
work in all cases, for example when such a foreign unit needs to be
instantiated with some code of my own : to my knowledge GNAT reparses
the foreign generic source at this moment, and I'm back with an
avalanche of style warnings.

Many thanks to Florian Weimer for pointing to Style_Checks pragma, which
allows you to customize the checks at the source level, in conjunction
with the compiler switches.
I was looking in the user's guide, not in the reference manual. My
fault.

Bye,
-- Herv�
-- 
      /\             Herv� BITTEUR                            
     \\ \            EMEA IT Architect
    \ \\ /           SUN MICROSYSTEMS FRANCE                  
   / \/ / /          13, avenue Morane Saulnier
  / /   \//\         78142 V�lizy cedex France
  \//\   / /         
   / / /\ /          Email  : Herve.Bitteur@France.Sun.COM
    / \\ \           Office : +33 (0)1.30.67.51.12
     \ \\            Fax.   : +33 (0)1.30.67.53.06
      \/



  reply	other threads:[~2001-05-22  8:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-05-21 15:50 Specific use of GNAT style checking Hervé Bitteur
2001-05-21 17:08 ` Jean-Pierre Rosen
2001-05-21 19:01   ` Pascal Obry
2001-05-21 18:59 ` Pascal Obry
2001-05-22  8:46   ` Hervé Bitteur [this message]
2001-05-21 20:13 ` Florian Weimer
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox