2
0
mirror of https://github.com/xcat2/xNBA.git synced 2024-11-22 17:41:55 +00:00

[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>
This commit is contained in:
Michael Brown 2010-09-22 19:59:37 +01:00
parent a5a4dcd0c7
commit 2a92697bda

View File

@ -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, ... ) {}
/**