From: SourceForge.net <no...@so...> - 2009-07-31 04:03:39
|
Patches item #2829951, was opened at 2009-07-31 10:11 Message generated for change (Comment added) made by dannysmith You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=302435&aid=2829951&group_id=2435 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: runtime Group: Patch needs review Status: Open Resolution: None Priority: 5 Private: No Submitted By: François-Xavier Coudert (coudert) Assigned to: Chris Sutcliffe (ir0nh34d) Summary: Issues with stdint.h header Initial Comment: GCC-4.5 has good coverage of the C99 types in stdint.h, and it currently has three failures on mingw32 (gcc.dg/c99-stdint-{1,5,6}.c), due to two issues: 1. int_fast8_t is defined as "char" instead of being "signed char" (as are int_least8_t and int8_t); this is potentially troublesome if one plays with char signedness; also, this is contrary to all headers I could find (except in those that are copied from the mingw32 one!) 2. the INT8_C, INT16_C, INT32_C, UINT8_C, UINT16_C and UINT32_C macros don't have the right type; they should have simple "int" type, except for UINT32_C which should have "unsigned" type; some explaination of why this is so can be found here by GCC's C99 "resident expert" (http://sourceware.org/ml/newlib/2008/msg00663.html) With the attached patch, all GCC C99 tests pass. ---------------------------------------------------------------------- >Comment By: Danny Smith (dannysmith) Date: 2009-07-31 16:03 Message: I think your changes have already been incorporated into CVS as of 2009-04-11 Danny Smith <dan...@us...> * include/stdint.h (int_fast8_t): Specify as signed char. (INT8_C, UINT8_C, INT16_C, UINT16_C): Simplify: just allow promotion to int. (INT32_C, UINT32_C): Remove 'L' type specifier on constant. ---------------------------------------------------------------------- Comment By: Chris Sutcliffe (ir0nh34d) Date: 2009-07-31 14:26 Message: I'm curious, for the second part of the patch, why have the UINT* macros lost their unsigned attribute? For example, looking at the link you specified: /** Macros for minimum-width integer constant expressions */ #define INT8_C(x) x +#if __STDINT_EXP(INT_MAX) > 0x7f +#define UINT8_C(x) x +#else #define UINT8_C(x) x##U +#endif in your patch, there is no check to see what the INT_MAX is, you simply set it to return val. Is this correct? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=302435&aid=2829951&group_id=2435 |