mailing list of musl libc
 help / color / mirror / code / Atom feed
From: croco@openwall.com
To: musl@lists.openwall.com
Subject: Re: the size of the int type
Date: Sat, 16 Jan 2016 14:09:17 +0300	[thread overview]
Message-ID: <20160116110916.GA20353@openwall.com> (raw)
In-Reply-To: <CAMAJcuDcB3PG1NSXr69bPTHvQmOdZtXEghR4+OnidfzfpQCTpw@mail.gmail.com>

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 <stdint.h>: 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


  parent reply	other threads:[~2016-01-16 11:09 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-15 21:01 Max Ruttenberg
2016-01-15 21:11 ` Josiah Worcester
2016-01-15 21:19   ` Max Ruttenberg
2016-01-16 11:09   ` croco [this message]
2016-01-16 13:09     ` Jens Gustedt
2016-01-18 15:22       ` Max Ruttenberg
2016-01-15 21:33 ` Rich Felker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160116110916.GA20353@openwall.com \
    --to=croco@openwall.com \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).