]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Simplify assertion to remove CodePeer message
authorYannick Moy <moy@adacore.com>
Thu, 29 Jun 2023 12:14:39 +0000 (12:14 +0000)
committerMarc Poulhiès <poulhies@adacore.com>
Mon, 10 Jul 2023 12:41:39 +0000 (14:41 +0200)
CodePeer is correctly warning on a test always true in an assertion.
It can be rewritten without loss of proof to avoid that message.

gcc/ada/

* libgnat/s-aridou.adb (Lemma_Powers_Of_2_Commutation): Rewrite
assertion.

gcc/ada/libgnat/s-aridou.adb

index 7ebf8682b320d2cce86c126393b6bdc7e5a858dd..2f1fbd554531656bbfb59fa589b9b8979126500f 100644 (file)
@@ -1456,9 +1456,7 @@ is
             pragma Assert (Big (Double_Uns'(2))**M = Big_2xx (M));
          end if;
       else
-         pragma Assert
-           (Big (Double_Uns'(2))**M =
-             (if M < Double_Size then Big_2xx (M) else Big_2xxDouble));
+         pragma Assert (Big (Double_Uns'(2))**M = Big_2xx (M));
       end if;
    end Lemma_Powers_Of_2_Commutation;