comp.lang.ada
 help / color / mirror / Atom feed
From: anon@anon.org (anon)
Subject: Re: GNAT: Weird Style Warnings
Date: Sun, 26 Oct 2008 15:22:16 GMT
Date: 2008-10-26T15:22:16+00:00	[thread overview]
Message-ID: <IW%Mk.5869$_Y1.5349@bgtnsc05-news.ops.worldnet.att.net> (raw)
In-Reply-To: 6078a089-927b-4756-81a8-7c344df1ee16@u65g2000hsc.googlegroups.com

GNAT uses an Indentation value of 3, so when you reassign the indentation to 2 
some system files may report this error when scanned.

The best solution is to either use indentation of 3 in your program or skip 
the indentation style check.


In <6078a089-927b-4756-81a8-7c344df1ee16@u65g2000hsc.googlegroups.com>, jacob.m.h.smith@googlemail.com writes:
>Hello.
>
>I am pretty new to Ada and I have a problem I'm not able to solve.
>I compile my files with the following GNAT style switch: -
>gnaty2acefhiklmM78nprt
>When compiling this one adb file I always get the following message:
>s-expuns.ads:42:04: (style) bad indentation
>s-expuns.ads:44:04: (style) bad indentation
>I have no idea why. This file "s-expuns.ads" is not one of mine, it
>must be part of
>some library. Does anyone know the meaning of this?
>
>Here's the program text (It's no important project, I was just
>experimenting):
>
>-----------------------------------------------------------------------------
>with Ada.Integer_Text_IO, Interfaces;
>use  Ada.Integer_Text_IO, Interfaces;
>
>procedure Bit_Extraction is
>
>  subtype Byte is Unsigned_8;
>
>  function Get_Bits (The_Byte, Mask : Byte) return Byte is
>    Position : Natural := 0;
>  begin
>    while ((2**Position and Mask) = 0) loop
>      Position := Position + 1;
>    end loop;
>    return Shift_Right ((The_Byte and Mask), Position);
>  end Get_Bits;
>
>  Test_Byte, Test_Result : Byte;
>
>begin
>
>  --  Test_Byte: 247 => 11110111
>  Test_Byte := 247;
>
>  --  Test_Result: 7 => 111
>  Test_Result := Get_Bits (Test_Byte, 224);
>
>  Put (Integer (Test_Result), 0);
>
>end Bit_Extraction;
>-----------------------------------------------------------------------------
>
>Greetings,
>Jacob M. H. Smith




  reply	other threads:[~2008-10-26 15:22 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-26 12:17 GNAT: Weird Style Warnings jacob.m.h.smith
2008-10-26 15:22 ` anon [this message]
2008-10-26 18:11 ` Georg Bauhaus
2008-10-26 20:41 ` Jeffrey R. Carter
2008-11-01 21:07 ` sjw
2008-11-05 19:09 ` jacob.m.h.smith
2008-11-05 20:40   ` John B. Matthews
2008-11-06 20:30     ` jacob.m.h.smith
replies disabled

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