From: Michael Brown Date: Wed, 22 Sep 2010 18:59:37 +0000 (+0100) Subject: [libc] Ensure that error numbers from EUNIQ() have the correct type X-Git-Tag: v1.20.1~2485 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2a92697bda9405523d350c5698398d61468fa9fd;p=thirdparty%2Fipxe.git [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 --- 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, ... ) {} /**