From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 7871) id 25ACB3857BB3; Tue, 20 Jun 2023 07:47:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 25ACB3857BB3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1687247238; bh=TcVVV7MLDIMxGRwivvgc7TTOIjufKWHS9ZXIITSJjLI=; h=From:To:Subject:Date:From; b=QhITWfamGDX6RABiezZ6QwSrwzgGDFGvh3qbxJKrOuyCPG3sNgpWkDWCx/WQE59ag 3fe94U3gtU2n4fpooIQ8L2wUE2W1fTiPGevazwCODQYMTYJK4Nzfp0shd8eigX9jSm TvuKodc6XjpQptBS/9MQtjbHEZrz+4ugKh7Za5S4= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Marc Poulhi?s To: gcc-cvs@gcc.gnu.org Subject: [gcc r14-1978] ada: Fix couple of issues in documentation of overflow checking X-Act-Checkin: gcc X-Git-Author: Eric Botcazou X-Git-Refname: refs/heads/master X-Git-Oldrev: 8912b95779dd233fb3a8c8b4dda033ed7b50be31 X-Git-Newrev: eb5c593cab9c8e88bc83767b738307e31285c733 Message-Id: <20230620074718.25ACB3857BB3@sourceware.org> Date: Tue, 20 Jun 2023 07:47:18 +0000 (GMT) List-Id: https://gcc.gnu.org/g:eb5c593cab9c8e88bc83767b738307e31285c733 commit r14-1978-geb5c593cab9c8e88bc83767b738307e31285c733 Author: Eric Botcazou Date: Fri Jun 2 00:11:05 2023 +0200 ada: Fix couple of issues in documentation of overflow checking There is still a mention of the defunct CHECKED mode and the Default Settings paragraph is confusing with regard to the -gnato switch. gcc/ada/ * doc/gnat_ugn/gnat_and_program_execution.rst (Overflows in GNAT) : Remove obsolete paragraph about -gnato. : Replace CHECKED with STRICT. * gnat_ugn.texi: Regenerate. Diff: --- .../doc/gnat_ugn/gnat_and_program_execution.rst | 23 +++-------------- gcc/ada/gnat_ugn.texi | 30 +++------------------- 2 files changed, 7 insertions(+), 46 deletions(-) diff --git a/gcc/ada/doc/gnat_ugn/gnat_and_program_execution.rst b/gcc/ada/doc/gnat_ugn/gnat_and_program_execution.rst index 9eb6b1c60aa..62abca24f41 100644 --- a/gcc/ada/doc/gnat_ugn/gnat_and_program_execution.rst +++ b/gcc/ada/doc/gnat_ugn/gnat_and_program_execution.rst @@ -2925,25 +2925,8 @@ The default mode for overflow checks is General => Strict -which causes all computations both inside and outside assertions to use -the base type. - -This retains compatibility with previous versions of -GNAT which suppressed overflow checks by default and always -used the base type for computation of intermediate results. - -.. Sphinx allows no emphasis within :index: role. As a workaround we - point the index to "switch" and use emphasis for "-gnato". - -The :index:`switch <-gnato (gcc)>` :switch:`-gnato` (with no digits following) -is equivalent to - - :: - - General => Strict - -which causes overflow checking of all intermediate overflows -both inside and outside assertions against the base type. +which causes all computations both inside and outside assertions to use the +base type, and is equivalent to :switch:`-gnato` (with no digits following). The pragma ``Suppress (Overflow_Check)`` disables overflow checking, but it has no effect on the method used for computing @@ -2964,7 +2947,7 @@ reasonably efficient, and can be generally used. It also helps to ensure compatibility with code imported from some other compiler to GNAT. -Setting all intermediate overflows checking (``CHECKED`` mode) +Setting all intermediate overflows checking (``STRICT`` mode) makes sense if you want to make sure that your code is compatible with any other possible Ada implementation. This may be useful in ensuring portability diff --git a/gcc/ada/gnat_ugn.texi b/gcc/ada/gnat_ugn.texi index a63e1d428c3..b85711b1b5d 100644 --- a/gcc/ada/gnat_ugn.texi +++ b/gcc/ada/gnat_ugn.texi @@ -21644,30 +21644,8 @@ General => Strict @end example @end quotation -which causes all computations both inside and outside assertions to use -the base type. - -This retains compatibility with previous versions of -GNAT which suppressed overflow checks by default and always -used the base type for computation of intermediate results. - -@c Sphinx allows no emphasis within :index: role. As a workaround we -@c point the index to "switch" and use emphasis for "-gnato". - -The -@geindex -gnato (gcc) -switch @code{-gnato} (with no digits following) -is equivalent to - -@quotation - -@example -General => Strict -@end example -@end quotation - -which causes overflow checking of all intermediate overflows -both inside and outside assertions against the base type. +which causes all computations both inside and outside assertions to use the +base type, and is equivalent to @code{-gnato} (with no digits following). The pragma @code{Suppress (Overflow_Check)} disables overflow checking, but it has no effect on the method used for computing @@ -21687,7 +21665,7 @@ reasonably efficient, and can be generally used. It also helps to ensure compatibility with code imported from some other compiler to GNAT. -Setting all intermediate overflows checking (@code{CHECKED} mode) +Setting all intermediate overflows checking (@code{STRICT} mode) makes sense if you want to make sure that your code is compatible with any other possible Ada implementation. This may be useful in ensuring portability @@ -29550,8 +29528,8 @@ to permit their use in free software. @printindex ge -@anchor{gnat_ugn/gnat_utility_programs switches-related-to-project-files}@w{ } @anchor{d1}@w{ } +@anchor{gnat_ugn/gnat_utility_programs switches-related-to-project-files}@w{ } @c %**end of body @bye