Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #35002

Re: 64-bit integers where the implementation supports max 32-bit ints

From Keith Thompson <kst-u@mib.org>
Newsgroups comp.lang.c
Subject Re: 64-bit integers where the implementation supports max 32-bit ints
Date 2013-08-06 08:43 -0700
Organization None to speak of
Message-ID <lnzjsurfjn.fsf@nuthaus.mib.org> (permalink)
References (5 earlier) <ktqo42$i8e$1@dont-email.me> <ktqri5$43o$1@dont-email.me> <ktqtfq$fkb$1@dont-email.me> <ktqvse$see$1@dont-email.me> <a76ef076-8ad4-4448-8353-a162bb30461c@googlegroups.com>

Show all headers | View raw


Malcolm McLean <malcolm.mclean5@btinternet.com> writes:
> On Tuesday, August 6, 2013 3:12:47 PM UTC+1, James Harris wrote:
>> "James Kuyper" <jameskuyper@verizon.net> wrote in message 
>> 
>> sizeof sint_t    8
>> 
>> sizeof uint_t    8
>> 
>> The above set is for the 64-bit target which is why [su]int_t have size 8. 
>> (I believe gcc defaults to 4 byte ints on 64-bit targets.) 
>>
> int should be the natural register size, which means 64 bits on a 64 bit
> system. That also means that, expect for the annoying but practically 
> unimportant case of a byte array that takes up over half the memory,
> int can index any array.

Perhaps it "should".  Nevertheless, int is typically 32 bits on 64-bit
systems, probably because making it 64 bits would mean you can't have
both a 16-bit type and a 32-bit type (unless the implementation resorts
to extended integer types).

Perhaps it would have made sense to add a "short short" type, so you
could have:
    char        8 bits
    short short 16 bits
    short       32 bits
    int         64 bits
but I don't see that happening any time soon.

-- 
Keith Thompson (The_Other_Keith) kst-u@mib.org  <http://www.ghoti.net/~kst>
Working, but not speaking, for JetHead Development, Inc.
"We must do something.  This is something.  Therefore, we must do this."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"

Back to comp.lang.c | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

64-bit integers where the implementation supports max 32-bit ints "James Harris" <james.harris.1@gmail.com> - 2013-08-05 18:07 +0100
  Re: 64-bit integers where the implementation supports max 32-bit ints Shao Miller <sha0.miller@gmail.com> - 2013-08-05 13:16 -0400
  Re: 64-bit integers where the implementation supports max 32-bit ints glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2013-08-05 18:57 +0000
  Re: 64-bit integers where the implementation supports max 32-bit ints Keith Thompson <kst-u@mib.org> - 2013-08-05 12:24 -0700
    Re: 64-bit integers where the implementation supports max 32-bit ints "James Harris" <james.harris.1@gmail.com> - 2013-08-05 22:37 +0100
      Re: 64-bit integers where the implementation supports max 32-bit ints Robert Wessel <robertwessel2@yahoo.com> - 2013-08-05 20:20 -0500
        Re: 64-bit integers where the implementation supports max 32-bit ints Robert Wessel <robertwessel2@yahoo.com> - 2013-08-05 23:34 -0500
      Re: 64-bit integers where the implementation supports max 32-bit ints Keith Thompson <kst-u@mib.org> - 2013-08-05 18:42 -0700
        Re: 64-bit integers where the implementation supports max 32-bit ints "James Harris" <james.harris.1@gmail.com> - 2013-08-06 11:15 +0100
          Re: 64-bit integers where the implementation supports max 32-bit ints James Kuyper <jameskuyper@verizon.net> - 2013-08-06 08:00 -0400
            Re: 64-bit integers where the implementation supports max 32-bit ints "James Harris" <james.harris.1@gmail.com> - 2013-08-06 13:59 +0100
              Re: 64-bit integers where the implementation supports max 32-bit ints James Kuyper <jameskuyper@verizon.net> - 2013-08-06 09:31 -0400
                Re: 64-bit integers where the implementation supports max 32-bit ints "James Harris" <james.harris.1@gmail.com> - 2013-08-06 15:12 +0100
                Re: 64-bit integers where the implementation supports max 32-bit ints Malcolm McLean <malcolm.mclean5@btinternet.com> - 2013-08-06 07:19 -0700
                Re: 64-bit integers where the implementation supports max 32-bit ints Keith Thompson <kst-u@mib.org> - 2013-08-06 08:43 -0700
                Re: 64-bit integers where the implementation supports max 32-bit ints Ian Collins <ian-news@hotmail.com> - 2013-08-07 15:51 +1200
                Re: 64-bit integers where the implementation supports max 32-bit ints Stephen Sprunk <stephen@sprunk.org> - 2013-08-06 21:48 -0500
                Re: 64-bit integers where the implementation supports max 32-bit ints "James Harris" <james.harris.1@gmail.com> - 2013-08-07 11:11 +0100
                Re: 64-bit integers where the implementation supports max 32-bit ints Stephen Sprunk <stephen@sprunk.org> - 2013-08-07 05:46 -0500
                Re: 64-bit integers where the implementation supports max 32-bit ints Rosario1903 <Rosario@invalid.invalid> - 2013-08-07 17:38 +0200
                Re: 64-bit integers where the implementation supports max 32-bit ints Keith Thompson <kst-u@mib.org> - 2013-08-07 09:27 -0700
                Re: 64-bit integers where the implementation supports max 32-bit ints Rosario1903 <Rosario@invalid.invalid> - 2013-08-07 18:36 +0200
                Re: 64-bit integers where the implementation supports max 32-bit ints Keith Thompson <kst-u@mib.org> - 2013-08-07 10:04 -0700
                Re: 64-bit integers where the implementation supports max 32-bit ints Rosario1903 <Rosario@invalid.invalid> - 2013-08-07 19:49 +0200
                Re: 64-bit integers where the implementation supports max 32-bit ints Keith Thompson <kst-u@mib.org> - 2013-08-07 11:13 -0700
                Re: 64-bit integers where the implementation supports max 32-bit ints Joe Pfeiffer <pfeiffer@cs.nmsu.edu> - 2013-08-07 12:37 -0600
                Re: 64-bit integers where the implementation supports max 32-bit ints Rosario1903 <Rosario@invalid.invalid> - 2013-08-07 19:46 +0200
                Re: 64-bit integers where the implementation supports max 32-bit ints Stephen Sprunk <stephen@sprunk.org> - 2013-08-08 01:17 -0500
                Re: 64-bit integers where the implementation supports max 32-bit ints Phil Carmody <thefatphil_demunged@yahoo.co.uk> - 2013-08-08 09:54 +0300
                Re: 64-bit integers where the implementation supports max 32-bit ints Rosario1903 <Rosario@invalid.invalid> - 2013-08-08 16:38 +0200
                Re: 64-bit integers where the implementation supports max 32-bit ints Keith Thompson <kst-u@mib.org> - 2013-08-08 08:27 -0700
                Re: 64-bit integers where the implementation supports max 32-bit ints Keith Thompson <kst-u@mib.org> - 2013-08-07 09:05 -0700
                Re: 64-bit integers where the implementation supports max 32-bit ints Malcolm McLean <malcolm.mclean5@btinternet.com> - 2013-08-07 03:48 -0700
                Re: 64-bit integers where the implementation supports max 32-bit ints James Kuyper <jameskuyper@verizon.net> - 2013-08-06 11:55 -0400
                Re: 64-bit integers where the implementation supports max 32-bit ints Ben Bacarisse <ben.usenet@bsb.me.uk> - 2013-08-06 21:21 +0100
          Re: 64-bit integers where the implementation supports max 32-bit ints Keith Thompson <kst-u@mib.org> - 2013-08-06 08:38 -0700
        Re: 64-bit integers where the implementation supports max 32-bit ints "James Harris" <james.harris.1@gmail.com> - 2013-08-06 12:15 +0100
        Re: 64-bit integers where the implementation supports max 32-bit ints Eric Sosman <esosman@comcast-dot-net.invalid> - 2013-08-06 09:36 -0400
          Re: 64-bit integers where the implementation supports max 32-bit ints Tim Rentsch <txr@alumni.caltech.edu> - 2013-08-08 14:18 -0700
      Re: 64-bit integers where the implementation supports max 32-bit ints Malcolm McLean <malcolm.mclean5@btinternet.com> - 2013-08-06 05:30 -0700

csiph-web