]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[Ada] Justify false alarm from CodePeer analysis of GNAT
authorYannick Moy <moy@adacore.com>
Mon, 5 Sep 2022 14:19:36 +0000 (16:19 +0200)
committerMarc Poulhiès <poulhies@adacore.com>
Mon, 12 Sep 2022 08:16:52 +0000 (10:16 +0200)
Branch is determined as dead following a test always False by
CodePeer analysis, which is incorrect. Justify this false alarm
with an appropriate pragma Annotate.

gcc/ada/

* libgnat/s-imagei.adb (Image_Integer): Add justification.

gcc/ada/libgnat/s-imagei.adb

index 8997e3c5a7512e2a292399afd320ee1de44da14a..c467777c7b02c281d2771eeae087a8504d562393 100644 (file)
@@ -177,6 +177,8 @@ package body System.Image_I is
 
    begin
       if V >= 0 then
+         pragma Annotate (CodePeer, False_Positive, "test always false",
+                          "V can be positive");
          S (1) := ' ';
          P := 1;
          pragma Assert (P < S'Last);