From b271095d5076f837391b2726c1265ae2e91fafa8 Mon Sep 17 00:00:00 2001 From: Johannes Kliemann Date: Tue, 5 Apr 2022 16:25:43 +0000 Subject: [Ada] Fix Ada-QNX task priority conversion 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc/ada/libgnarl') diff --git a/gcc/ada/libgnarl/s-osinte__qnx.adb b/gcc/ada/libgnarl/s-osinte__qnx.adb index f446ac8cb..8315c12 100644 --- a/gcc/ada/libgnarl/s-osinte__qnx.adb +++ b/gcc/ada/libgnarl/s-osinte__qnx.adb @@ -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; ----------------- -- cgit v1.1