From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/2907 Path: news.gmane.org!not-for-mail From: Zvi Gilboa Newsgroups: gmane.linux.lib.musl.general Subject: Re: inttypes.h: possible logical error? Date: Wed, 13 Mar 2013 13:53:10 -0400 Message-ID: <5140BD06.1080905@eservices.virginia.edu> References: <5140A8C4.1050207@eservices.virginia.edu> <20130313172343.GF20323@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1363197205 10110 80.91.229.3 (13 Mar 2013 17:53:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 13 Mar 2013 17:53:25 +0000 (UTC) To: Original-X-From: musl-return-2908-gllmg-musl=m.gmane.org@lists.openwall.com Wed Mar 13 18:53:49 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 1UFps2-0001WO-Gf for gllmg-musl@plane.gmane.org; Wed, 13 Mar 2013 18:53:46 +0100 Original-Received: (qmail 22404 invoked by uid 550); 13 Mar 2013 17:53:23 -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 22395 invoked from network); 13 Mar 2013 17:53:23 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130221 Thunderbird/17.0.3 In-Reply-To: <20130313172343.GF20323@brightrain.aerifal.cx> X-Originating-IP: [68.229.98.213] Xref: news.gmane.org gmane.linux.lib.musl.general:2907 Archived-At: Thank you, Rich, for the quick feedback! You are of course absolutely right... Best regards, Zvi On 03/13/2013 01:23 PM, Rich Felker wrote: > 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