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=0.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,a5170f42aaba5839,start X-Google-Attributes: gid103376,public From: Andrew Lynch Subject: GNAT DOS vs. GNAT NT: Pragma Suppress? Date: 1997/03/20 Message-ID: <33313F49.640E@cci.de>#1/1 X-Deja-AN: 227034481 Distribution: world Organization: Competence Center Informatik GmbH Reply-To: lynch@cci.de Newsgroups: comp.lang.ada Date: 1997-03-20T00:00:00+00:00 List-Id: We are having problems with a sample program that should show the user what can happen when the Pragma Suppress is used. Depending on the user's system we have either GNAT 3.07 for DOS or GNAT 3.09 for Windows NT. Using the DOS compiler range checks can be suppressed, but the NT compiler still causes exceptions to be raised. The LRM 11.5(29) says that suppression of checks is not guaranteed, but I would expect GNAT to handle this the same on various platforms. GNAT on a Sun SPARC works the same as the DOS version, so why is the NT version the odd one out? Here is a shorter version of the code: ----------------->% snip %<-------------------- with Text_IO; procedure Supprchk is N : Natural := 0; I : Integer := -3; begin begin Text_IO.Put_Line( "Range_Check active"); Text_IO.Put("Natural: "); N := I; -- exception raised Text_IO.Put_Line(Natural'Image(N)); exception when Constraint_Error => Text_IO.Put_Line("assignment error"); end; declare pragma Suppress (Range_Check); begin Text_IO.Put_Line( "Range_Check turned off"); Text_IO.Put("Natural: "); N := I; -- exception with NT, but not with DOS or SPARC Text_IO.Put_Line(Natural'Image(N)); exception when Constraint_Error => Text_IO.Put_Line("assignment error"); end; end Supprchk; ----------------->% snip %<-------------------- Using GNAT for DOS (under NT!) or GNAT for SPARC the output is Range_Check active Natural: assignment error Range_Check turned off Natural: -3 With GNAT for NT the output is Range_Check active Natural: assignment error Range_Check turned off Natural: assignment error Is this deliberately different in the NT version, or should we maybe file a bug report..? Could other people try this with the Windows NT version of GNAT 3.09? In case it matters this was on a P120, running the German Windows NT 4.00.1381 Thanks, Andrew. -- +----------------------------------------------------------------------+ | Andrew Lynch, MEng / lynch@cci.de | Run, run, as fast as you | | CCI GmbH / alynch@iee.org | can. You can't catch me, | | Lohberg 10 /lynch@ug.cs.york.ac.uk | I'm the gingerbeard man! | | D-49716 Meppen / Tel. ++49 5931 805-243 | .sig by Anna Gramme | +----------------------------------------------------------------------+