]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[Ada] Fix Ada-QNX task priority conversion
authorJohannes Kliemann <kliemann@adacore.com>
Tue, 5 Apr 2022 16:25:43 +0000 (16:25 +0000)
committerPierre-Marie de Rodat <derodat@adacore.com>
Wed, 18 May 2022 08:41:06 +0000 (08:41 +0000)
The conversion between OS and Ada priorties should be done in the wider
Interfaces.C.int type rather than Any_Priority otherwise
Constraint_Error will be raised when coverting Any_Priority'Last to int.

gcc/ada/

* libgnarl/s-osinte__qnx.adb (To_Target_Priority): Perform
arithmetic in int.

gcc/ada/libgnarl/s-osinte__qnx.adb

index f446ac8cb6bc5b48fba5acfe6b10cc32571758de..8315c1250eb463fef0795bac640167ac382c7c49 100644 (file)
@@ -87,7 +87,7 @@ package body System.OS_Interface is
      (Prio : System.Any_Priority) return Interfaces.C.int
    is
    begin
-      return Interfaces.C.int (Prio + 1);
+      return Interfaces.C.int (Prio) + 1;
    end To_Target_Priority;
 
    -----------------