From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/9136 Path: news.gmane.org!not-for-mail From: croco@openwall.com Newsgroups: gmane.linux.lib.musl.general Subject: Re: the size of the int type Date: Sat, 16 Jan 2016 14:09:17 +0300 Message-ID: <20160116110916.GA20353@openwall.com> References: 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 1452942578 31131 80.91.229.3 (16 Jan 2016 11:09:38 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 16 Jan 2016 11:09:38 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-9149-gllmg-musl=m.gmane.org@lists.openwall.com Sat Jan 16 12:09:37 2016 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 1aKOjh-0002oo-JW for gllmg-musl@m.gmane.org; Sat, 16 Jan 2016 12:09:37 +0100 Original-Received: (qmail 29750 invoked by uid 550); 16 Jan 2016 11:09:33 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 29732 invoked from network); 16 Jan 2016 11:09:33 -0000 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Xref: news.gmane.org gmane.linux.lib.musl.general:9136 Archived-At: On Fri, Jan 15, 2016 at 09:11:25PM +0000, Josiah Worcester wrote: > You would do better to match the convention used on modern-day Unix > systems, where int is 32-bit, long is the machine word size, and long long > is 64-bit. If you do this everything should pretty much function as it > expects, with regard to the standard C types' sizes. Let me second this. Please note that in case you implement int as 64-bit, then there will be either no 32-bit or no 16-bit integer type (at all), as there's only the short which is in between char ant int; hence, well, there will be a kind of problem with some typedefs from : either int16_t/uint16_t or int32_t/uint32_t will actually have a size different from what the name suggests, so you'll run into a trouble with reading/analysing data in binary formats. -- Croco