|
Message-ID: <20141203145016.GK4574@brightrain.aerifal.cx> Date: Wed, 3 Dec 2014 09:50:16 -0500 From: Rich Felker <dalias@...c.org> To: musl@...ts.openwall.com Subject: Re: [PATCH 3/4] use exact types for the [U]INTXX_C macros On Wed, Dec 03, 2014 at 03:17:18PM +0100, Jens Gustedt wrote: > But looking at the text for the MIN/MAX constants I didn't find it > much clearer, there, to know what happens if the corresponding type is > promoted. E.g is UCHAR_MAX signed or unsigned in the preprocessor? My > guess is that it is signed, because it should have the promoted type, > but that requirement comes after the text for the preprocessor, so I > am not sure. > > (and yes it is unsigned if UCHAR_MAX is UINT_MAX :) 5.2.4.2.1 says "Moreover, except for CHAR_BIT and MB_LEN_MAX, the following shall be replaced by expressions that have the same type as would an expression that is an object of the corresponding type converted according to the integer promotions" I would assume their signedness at the preprocessor level is supposed to match the signesness of the types they're required to have, which would be int, and thus signed, for any unsigned type whose values are representable in int. Rich
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.