comp.lang.ada
 help / color / mirror / Atom feed
* Specific use of GNAT style checking
@ 2001-05-21 15:50 Hervé Bitteur
  2001-05-21 17:08 ` Jean-Pierre Rosen
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Hervé Bitteur @ 2001-05-21 15:50 UTC (permalink / raw)


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.
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.
So my question (no answer found while browsing the GNAT doc so far) :
How could I explicitly disable the style checking on some source files,
while keeping it active on some other ones.

Thanks for any clue.
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
      \/



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Specific use of GNAT style checking
  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-21 20:13 ` Florian Weimer
  2 siblings, 1 reply; 6+ messages in thread
From: Jean-Pierre Rosen @ 2001-05-21 17:08 UTC (permalink / raw)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 603 bytes --]


"Herv� Bitteur" <Herve.Bitteur@France.Sun.COM> a �crit dans le message news:
3B09393B.31E12172@France.Sun.COM...
> So my question (no answer found while browsing the GNAT doc so far) :
> How could I explicitly disable the style checking on some source files,
> while keeping it active on some other ones.
>
Compile once without -gnatg, then recompile your files with -gnatg. Since
foreign units won't be recompiled, that should do the trick...

--
---------------------------------------------------------
           J-P. Rosen (rosen@adalog.fr)
Visit Adalog's web site at http://www.adalog.fr





^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Specific use of GNAT style checking
  2001-05-21 15:50 Specific use of GNAT style checking Hervé Bitteur
  2001-05-21 17:08 ` Jean-Pierre Rosen
@ 2001-05-21 18:59 ` Pascal Obry
  2001-05-22  8:46   ` Hervé Bitteur
  2001-05-21 20:13 ` Florian Weimer
  2 siblings, 1 reply; 6+ messages in thread
From: Pascal Obry @ 2001-05-21 18:59 UTC (permalink / raw)



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.

-- 

--|------------------------------------------------------
--| Pascal Obry                           Team-Ada Member
--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE
--|------------------------------------------------------
--|         http://perso.wanadoo.fr/pascal.obry
--|
--| "The best way to travel is by means of imagination"



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Specific use of GNAT style checking
  2001-05-21 17:08 ` Jean-Pierre Rosen
@ 2001-05-21 19:01   ` Pascal Obry
  0 siblings, 0 replies; 6+ messages in thread
From: Pascal Obry @ 2001-05-21 19:01 UTC (permalink / raw)



"Jean-Pierre Rosen" <rosen@adalog.fr> writes:

> "Herv� Bitteur" <Herve.Bitteur@France.Sun.COM> a �crit dans le message news:
> 3B09393B.31E12172@France.Sun.COM...
> > So my question (no answer found while browsing the GNAT doc so far) :
> > How could I explicitly disable the style checking on some source files,
> > while keeping it active on some other ones.
> >
> Compile once without -gnatg, then recompile your files with -gnatg. Since
> foreign units won't be recompiled, that should do the trick...

Nop :) use -gnaty not -gnatg (-gnatg is an internal GNAT switch that should be
used to build GNAT only).

Pascal.

-- 

--|------------------------------------------------------
--| Pascal Obry                           Team-Ada Member
--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE
--|------------------------------------------------------
--|         http://perso.wanadoo.fr/pascal.obry
--|
--| "The best way to travel is by means of imagination"



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Specific use of GNAT style checking
  2001-05-21 15:50 Specific use of GNAT style checking Hervé Bitteur
  2001-05-21 17:08 ` Jean-Pierre Rosen
  2001-05-21 18:59 ` Pascal Obry
@ 2001-05-21 20:13 ` Florian Weimer
  2 siblings, 0 replies; 6+ messages in thread
From: Florian Weimer @ 2001-05-21 20:13 UTC (permalink / raw)


Herv� Bitteur <Herve.Bitteur@France.Sun.COM> writes:

> How could I explicitly disable the style checking on some source files,
> while keeping it active on some other ones.

Maybe youd could use pragma Style_Checks?



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Specific use of GNAT style checking
  2001-05-21 18:59 ` Pascal Obry
@ 2001-05-22  8:46   ` Hervé Bitteur
  0 siblings, 0 replies; 6+ messages in thread
From: Hervé Bitteur @ 2001-05-22  8:46 UTC (permalink / raw)




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
      \/



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2001-05-22  8:46 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2001-05-21 20:13 ` Florian Weimer

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