From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/9134 Path: news.gmane.org!not-for-mail From: Max Ruttenberg Newsgroups: gmane.linux.lib.musl.general Subject: Re: the size of the int type Date: Fri, 15 Jan 2016 16:19:03 -0500 Message-ID: References: Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a113cbd44e2b8d1052965f36c X-Trace: ger.gmane.org 1452892759 14596 80.91.229.3 (15 Jan 2016 21:19:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 15 Jan 2016 21:19:19 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-9147-gllmg-musl=m.gmane.org@lists.openwall.com Fri Jan 15 22:19:19 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 1aKBmA-0005Tl-1t for gllmg-musl@m.gmane.org; Fri, 15 Jan 2016 22:19:18 +0100 Original-Received: (qmail 7370 invoked by uid 550); 15 Jan 2016 21:19:16 -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 7352 invoked from network); 15 Jan 2016 21:19:15 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=emutechnology-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=0SnIIYl6fNH+iXxzKdAhXtKp7pczLi9PkKdzjs2QH90=; b=hQG7yRA7QzgDAZubiEFIBX5Sg7RfRY28/2HwuzQHTeZDP99Z6an7DKV9fJK807G25/ KMII4caI11ynqObvDZjq89PQCnbb7tqv/pGxXJCctsKHZbqqzeJlgpKGhXd+EsZvfvSi ubX0X+unyCKGOHwNRn/ZofyPfDTFI57R83OQG5fFl9ycT3S+nkK/jlQdIrm4qOrhbJhu Wf5ni/LpMAaHTWrE/xg1SHN6wnwOnKXRvMLAF0OZTwrNRqptuFfIOazF92wsR5yNoaNz Pb8/Z+LpWj0+h7kg43bUJdNqQ9Cpv1MBKUyGvrWyxJ9QqPThhqIw++1RTI+EhCflXZpT BxzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=0SnIIYl6fNH+iXxzKdAhXtKp7pczLi9PkKdzjs2QH90=; b=ej7r4hkHobCq68co+zOAGArv0GIB0XJmz3xYvtmfl2J7XZ5PNNZq/t0YGmwJSVULkf ByLRidaI/PWxlxX5vbLwwFdReWIabzL1nNhRCa9UrsVE+x50H7FXYkUyfbh3n0pD5dVE 9LhnGkjCe5snunDuPH0dt0IdmEfXATqJhA67o3NTvMdoOQAjELj6ftMhZmkaPY6+Wjyu xeamV9v/816EUXQ63cydHjsV4HDfxl/BJeHDWM2Jb8mwhzkYMn9WSqBrPjkC8th47lFa zQlf7aI0cN5oq1aGF4rkPM+qcZ+kjvW3aRrqX3waGZQZg1p3o7FOhls2ylM8htsWH689 xovw== X-Gm-Message-State: ALoCoQmjFlbPmKIQInth1PWNK0dJsL7A3yjzsac2Gr5TJPsJms1QAWlZ032y9eC0vXKXS/gxs2udp4K1tDCElfqYZRtmZz7X8Q== X-Received: by 10.202.168.197 with SMTP id r188mr9803309oie.44.1452892743704; Fri, 15 Jan 2016 13:19:03 -0800 (PST) In-Reply-To: Xref: news.gmane.org gmane.linux.lib.musl.general:9134 Archived-At: --001a113cbd44e2b8d1052965f36c Content-Type: text/plain; charset=UTF-8 Thank you! On Fri, Jan 15, 2016 at 4:11 PM, Josiah Worcester wrote: > I do not know of anything in musl that assumes "int" is 32-bit, but I'm > confident that implementing it as anything else will break a large amount > of third party code. Practically all platforms in common use have 32-bit > int (regardless of the machine's word size), and as such a lot of code > relies on this (implicitly or explicitly). > 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. > > On Fri, Jan 15, 2016 at 1:01 PM Max Ruttenberg < > mruttenberg@emutechnology.com> wrote: > >> Hi, >> >> I'm wondering if there's any code in musl that makes assumptions on the >> size of the "int" type. >> >> I only ask because I'm debating how my compiler (which targets a machine >> with a 64-bit word size) should define the int type. Ideally I'd like to >> break as little library code as possible. >> >> Max >> > -- Max Ruttenberg, Member of the Technical Staff Emu *Technology* 1400 E Angela Blvd, Unit 101 South Bend, IN 46617 --001a113cbd44e2b8d1052965f36c Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Thank you!

On Fri, Jan 15, 2016 at 4:11 PM, Josiah Worcester <josiah= w@gmail.com> wrote:
I do not know of anything in musl that assumes "int" is= 32-bit, but I'm confident that implementing it as anything else will b= reak a large amount of third party code. Practically all platforms in commo= n use have 32-bit int (regardless of the machine's word size), and as s= uch a lot of code relies on this (implicitly or explicitly).
You would d= o 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 t= o the standard C types' sizes.

On Fri, Jan 15, 2016 a= t 1:01 PM Max Ruttenberg <mruttenberg@emutechnology.com> wrote:
=
Hi,

I= 9;m wondering if there's any code in musl that makes assumptions on the= size of the "int" type.

I only ask beca= use I'm debating how my compiler (which targets a machine with a 64-bit= word size) should define the int type. Ideally I'd like to break as li= ttle library code as possible.

Max



--
=
Max Ruttenbe= rg,
Member of the Technical Staff
Emu=C2=A0Technology
1400 E Angela Blvd, Unit 101
South Bend, IN 46617
<= /div>
--001a113cbd44e2b8d1052965f36c--