From 9c42752caca6c5136854b499e5e14d2891e0c195 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Wed, 17 Aug 2016 07:33:14 +0200 Subject: score: Fix undefined behaviour Cast POSIX error codes to unsigned int to avoid undefined behaviour in case of PTHREAD_BARRIER_SERIAL_THREAD which is -1. --- cpukit/score/include/rtems/score/status.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpukit/score/include/rtems/score/status.h b/cpukit/score/include/rtems/score/status.h index a4b2de9d26..453bf1143c 100644 --- a/cpukit/score/include/rtems/score/status.h +++ b/cpukit/score/include/rtems/score/status.h @@ -53,7 +53,7 @@ typedef enum { */ #if defined(RTEMS_POSIX_API) #define STATUS_BUILD( classic_status, posix_status ) \ - ( ( ( posix_status ) << 8 ) | ( classic_status ) ) + ( ( ( (unsigned int) ( posix_status ) ) << 8 ) | ( classic_status ) ) #else #define STATUS_BUILD( classic_status, posix_status ) \ ( classic_status ) -- cgit v1.2.3