diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-08-17 07:33:14 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-08-18 07:27:51 +0200 |
commit | 9c42752caca6c5136854b499e5e14d2891e0c195 (patch) | |
tree | b5ea2b1b452a38a5a083d5dbe5a07141092667e8 | |
parent | testsuite: Add libdl/dl04 cache test. (diff) | |
download | rtems-9c42752caca6c5136854b499e5e14d2891e0c195.tar.bz2 |
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.
-rw-r--r-- | cpukit/score/include/rtems/score/status.h | 2 |
1 files changed, 1 insertions, 1 deletions
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 ) |