From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/6672 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: [PATCH 3/4] use exact types for the [U]INTXX_C macros Date: Wed, 3 Dec 2014 09:50:16 -0500 Message-ID: <20141203145016.GK4574@brightrain.aerifal.cx> References: <1416926886.16006.925.camel@eris.loria.fr> <20141202180355.GD29621@brightrain.aerifal.cx> <1417548001.4936.1106.camel@eris.loria.fr> <20141202194435.GG29621@brightrain.aerifal.cx> <1417556274.4936.1130.camel@eris.loria.fr> <20141203000132.GA4574@brightrain.aerifal.cx> <1417602004.4936.1233.camel@eris.loria.fr> <20141203132155.GD9258@port70.net> <1417616238.4936.1307.camel@eris.loria.fr> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1417618239 32128 80.91.229.3 (3 Dec 2014 14:50:39 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 3 Dec 2014 14:50:39 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-6685-gllmg-musl=m.gmane.org@lists.openwall.com Wed Dec 03 15:50:33 2014 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1XwBGA-0003ig-WD for gllmg-musl@m.gmane.org; Wed, 03 Dec 2014 15:50:31 +0100 Original-Received: (qmail 12202 invoked by uid 550); 3 Dec 2014 14:50:29 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 12194 invoked from network); 3 Dec 2014 14:50:28 -0000 Content-Disposition: inline In-Reply-To: <1417616238.4936.1307.camel@eris.loria.fr> User-Agent: Mutt/1.5.21 (2010-09-15) Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:6672 Archived-At: 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