[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>
pull/1/head
Michael Brown 2010-09-22 19:59:37 +01:00
parent a5a4dcd0c7
commit 2a92697bda
1 changed files with 1 additions and 1 deletions

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