From patchwork Tue Jun 20 07:52:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Marc_Poulhi=C3=A8s?= X-Patchwork-Id: 110318 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp3498785vqr; Tue, 20 Jun 2023 01:00:48 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ49AE9Gv8/BoNdbbm063ZI0KZe2uEVRxui9yr7TPQQSOqTDktM9bRErsx9oxosNvYYKF3jm X-Received: by 2002:a05:6402:4302:b0:514:a21b:f137 with SMTP id m2-20020a056402430200b00514a21bf137mr15255840edc.6.1687248048333; Tue, 20 Jun 2023 01:00:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687248048; cv=none; d=google.com; s=arc-20160816; b=c0eaIJywiRmNPp4CQH7g/1VGFfugYftEHxgMTAtLWRsPCVXFHrgB047NTKAmWg+mXt 1s35Ba5hEXT88lEc95gQnkA78FGWf/wwJzpqiL/KO573TZStsmWWRd9tlqOJ/mGi2jbU Eg7EMF8Ii2ZLQs8IpJHEVGCs1SkQ5jKyL2tauAUHRDPM3Rdk88XmrjrxUJeigdH/tBTm 6WfJV7aQVVj1eCwO7J6LnTTVZqxVuZln2xifiPLFccgxHjyqkaW/SZk+oFy84Qxh1Vyo eNB2dcdMCGo1q22eKWH96cS6o2PxYQOUY8z6UINpK0YMh9NR5r/mGwxFQ4t0O+JwwasJ 2ZBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:message-id:date:subject:cc :to:dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=4brHQS4pwgWydZ5FeqLGsjt6swtpG4PxB9Z9cTWToPk=; b=QSMYFKtpJBOA6QGyznPWOnBQOk9JGWN2cm8bE+hSUrjKLBV1lzXEn5uO8KuQ1oSQjt 4LqdAzdouH7Uu6T0dmP61eRFUgLOjGJCL7d7195CpikIt7heymhO9d/eFMRXoHGdrBVm hojZytzVs3k4DDaWM5JpqUpxO+0wIF6amyQhhFQxgxDYA4/E5iFO5EraXwdwJm/FufPf NaRyl9JhXFYUp0ZVZJDXBssgK14S95FGCx0XD3tP1fYKbtg+QxmJM0BqX9qGiLjBjANT T9PJ/UVuRS/SlvAsrYXmVF7JjwuNO17ZsFn2SyN35CeanYT3jz2MvC4p+2c/nmUQXYGs 2rOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=eljqIrAq; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id b11-20020aa7c6cb000000b005187a3f512csi874646eds.635.2023.06.20.01.00.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Jun 2023 01:00:48 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=eljqIrAq; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E2C513893646 for ; Tue, 20 Jun 2023 07:54:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E2C513893646 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1687247642; bh=4brHQS4pwgWydZ5FeqLGsjt6swtpG4PxB9Z9cTWToPk=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=eljqIrAq231x2Itd1ZoL/isIiMI0KHTJ4QnkrcDHxpBJ7H8FsS9CsgdV81Yd7uwa6 +GcsURjJFhwMcCvcwzsFLlVBfc15c9JY6zUPk+QXXsyDfbNKQhFYbaBuFB0s1YuKQd xk36S+gxXbnff2KTrcrJ1YHZbzFjgQVrw74Vlqzk= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com [IPv6:2a00:1450:4864:20::42b]) by sourceware.org (Postfix) with ESMTPS id 9116938A8163 for ; Tue, 20 Jun 2023 07:52:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9116938A8163 Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-3112902f785so2542045f8f.0 for ; Tue, 20 Jun 2023 00:52:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687247536; x=1689839536; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=4brHQS4pwgWydZ5FeqLGsjt6swtpG4PxB9Z9cTWToPk=; b=dWojzlwkJbsifPrAPAFUXByOuqZwpA7+2G7fKguxBuW/9IWZ2cH+f1hNodYaiCOtcA t+cc6qYrEWzE2I34eMxRHaKZIIiIIIxhhhezHJVs7LB6ejEBX7HBZ12p7f/IATDSGqXv kxHdMynhfrLwT/2Sc9HqAv4j4nb1dry/a3nOIhjWVy+pM/QJZzrkhQYq0ggwNn/qkft0 S2xU1h5RBjqd3UuAWkiXdnEIBf6g2sMbY9YYHY/ZYsDVOxnbhYr0C2YwZZbFMRFUA+f9 L09brREsQCNScZrjxATZvKo8vCofXxx70/AiiFmKFedQRruHJL03cSmCYVp3paHFOAkb DyPg== X-Gm-Message-State: AC+VfDzgZq77XuziXHfGdso6fO/OA9JoM+eIN4rJitHTIK7AC7ntLmkG xRe9iRsRCwvYoLYa++Hq7LqcHFm0WMKb74CrhSrrWA== X-Received: by 2002:a5d:6e03:0:b0:30f:bb2f:705 with SMTP id h3-20020a5d6e03000000b0030fbb2f0705mr14641116wrz.22.1687247536230; Tue, 20 Jun 2023 00:52:16 -0700 (PDT) Received: from poulhies-Precision-5550.lan ([2001:861:3382:1a90:4c16:36ea:1b76:c001]) by smtp.gmail.com with ESMTPSA id i15-20020a5d55cf000000b0030633152664sm1331408wrw.87.2023.06.20.00.52.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Jun 2023 00:52:15 -0700 (PDT) To: gcc-patches@gcc.gnu.org Cc: Eric Botcazou Subject: [COMMITTED] ada: Fix couple of issues in documentation of overflow checking Date: Tue, 20 Jun 2023 09:52:14 +0200 Message-Id: <20230620075214.1253753-1-poulhies@adacore.com> X-Mailer: git-send-email 2.40.0 MIME-Version: 1.0 X-Spam-Status: No, score=-13.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: =?utf-8?q?Marc_Poulhi=C3=A8s_via_Gcc-patches?= From: =?utf-8?q?Marc_Poulhi=C3=A8s?= Reply-To: =?utf-8?q?Marc_Poulhi=C3=A8s?= Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1769207809496174845?= X-GMAIL-MSGID: =?utf-8?q?1769207809496174845?= From: Eric Botcazou 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. Tested on x86_64-pc-linux-gnu, committed on master. --- .../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