summaryrefslogtreecommitdiffstats
path: root/src/include/errno.h
diff options
context:
space:
mode:
authorMichael Brown2010-09-22 20:59:37 +0200
committerMichael Brown2010-09-22 21:04:11 +0200
commit2a92697bda9405523d350c5698398d61468fa9fd (patch)
tree762a8c46d58c04a3acf84d90419fa80443f2a82e /src/include/errno.h
parent[fcp] Add support for describing an FCP device using EDD (diff)
downloadipxe-2a92697bda9405523d350c5698398d61468fa9fd.tar.gz
ipxe-2a92697bda9405523d350c5698398d61468fa9fd.tar.xz
ipxe-2a92697bda9405523d350c5698398d61468fa9fd.zip
[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.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/include/errno.h b/src/include/errno.h
index 45d53823..a86573fc 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, ... ) {}
/**