diff options
author | Michael Brown <mcb30@ipxe.org> | 2010-09-22 19:59:37 +0100 |
---|---|---|
committer | Michael Brown <mcb30@ipxe.org> | 2010-09-22 20:04:11 +0100 |
commit | 2a92697bda9405523d350c5698398d61468fa9fd (patch) | |
tree | 762a8c46d58c04a3acf84d90419fa80443f2a82e /src/include/errno.h | |
parent | a5a4dcd0c702d73a61b796e9a5d84433f162693c (diff) | |
download | ipxe-2a92697bda9405523d350c5698398d61468fa9fd.tar.gz |
[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 <mcb30@ipxe.org>
Diffstat (limited to 'src/include/errno.h')
-rw-r--r-- | src/include/errno.h | 2 |
1 files changed, 1 insertions, 1 deletions
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, ... ) {} /** |