diff options
author | Johannes Kliemann <kliemann@adacore.com> | 2022-04-05 16:25:43 +0000 |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2022-05-18 08:41:06 +0000 |
commit | b271095d5076f837391b2726c1265ae2e91fafa8 (patch) | |
tree | 109a1048549c9ff52400cf04bed4125cbd8dfe41 /gcc/ada/libgnarl | |
parent | ef07419f73ac5cc436282a607591e289bb480626 (diff) | |
download | gcc-b271095d5076f837391b2726c1265ae2e91fafa8.zip gcc-b271095d5076f837391b2726c1265ae2e91fafa8.tar.gz gcc-b271095d5076f837391b2726c1265ae2e91fafa8.tar.bz2 |
[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.
Diffstat (limited to 'gcc/ada/libgnarl')
-rw-r--r-- | gcc/ada/libgnarl/s-osinte__qnx.adb | 2 |
1 files changed, 1 insertions, 1 deletions
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; ----------------- |