From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/2906 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: inttypes.h: possible logical error? Date: Wed, 13 Mar 2013 13:23:43 -0400 Message-ID: <20130313172343.GF20323@brightrain.aerifal.cx> References: <5140A8C4.1050207@eservices.virginia.edu> 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 1363195440 24261 80.91.229.3 (13 Mar 2013 17:24:00 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 13 Mar 2013 17:24:00 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-2907-gllmg-musl=m.gmane.org@lists.openwall.com Wed Mar 13 18:24:25 2013 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1UFpPZ-0005bD-N3 for gllmg-musl@plane.gmane.org; Wed, 13 Mar 2013 18:24:21 +0100 Original-Received: (qmail 7344 invoked by uid 550); 13 Mar 2013 17:23:58 -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 7336 invoked from network); 13 Mar 2013 17:23:58 -0000 Content-Disposition: inline In-Reply-To: <5140A8C4.1050207@eservices.virginia.edu> User-Agent: Mutt/1.5.21 (2010-09-15) Xref: news.gmane.org gmane.linux.lib.musl.general:2906 Archived-At: On Wed, Mar 13, 2013 at 12:26:44PM -0400, Zvi Gilboa wrote: > Greetings, > > In inttypes.h, the first "actual" lines read: > > .... > #include > #include > > #define __NEED_wchar_t > #include > .... > > As it seems, the idea is to have processed with > __NEED_wchar_t already defined. However, is also > included by . > > In a way this is rather harmless, specifically since > can be processed more than once, yet wouldn't it > be more logical and/or consistent to #define __NEED_wchar_t prior > to including ? Given no conflicting considerations, the > above code snippet would then read: > > .... > #define __NEED_wchar_t > > #include > #include > #include /* possibly redundant? see stdint.h */ > .... > > Thanks in advance for any and all feedback! I wouldn't call it an error. It's a suboptimality, but the tradeoff is that one header (inttypes.h) is not making assumptions about the implementation of the other. If others want to see this changed to save an #include, we could consider it, but it would need to be commented that the optimization depends on the implementation of stdint.h. Rich