From 2a92697bda9405523d350c5698398d61468fa9fd Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Wed, 22 Sep 2010 19:59:37 +0100 Subject: [PATCH] [libc] Ensure that error numbers from EUNIQ() have the correct type Error numbers are signed ints. EUNIQ() should not allow implicit type promotion based on the supplied error diambiguator, because this causes problems with statements such as rc = ( condition ? -EUNIQ ( EBASE, disambiguator ) : -EBASE ); Signed-off-by: Michael Brown --- src/include/errno.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/include/errno.h b/src/include/errno.h index 45d538235..a86573fc9 100644 --- a/src/include/errno.h +++ b/src/include/errno.h @@ -201,7 +201,7 @@ extern char missing_errfile_declaration[] __attribute__ (( deprecated )); */ #define EUNIQ( errno, uniq, ... ) ( { \ euniq_discard ( 0, ##__VA_ARGS__); \ - ( (errno) | ( (uniq) << 8 ) ); } ) + ( ( int ) ( (errno) | ( (uniq) << 8 ) ) ); } ) static inline void euniq_discard ( int dummy __unused, ... ) {} /**