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


Groups > comp.lang.c > #23625

Re: Unsinged types

Date 2012-07-23 14:02 -0400
From Kenneth Brody <kenbrody@spamcop.net>
Newsgroups comp.lang.c
Subject Re: Unsinged types
References (2 earlier) <ec1fc3a5-285e-4f8f-a408-63a0e8e0a895@googlegroups.com> <0.9b7c0619018528920291.20120721152438BST.874np19opl.fsf@bsb.me.uk> <5c390903-75bd-477d-a422-592f60a17d19@googlegroups.com> <jueous$coh$1@dont-email.me> <eeb1fd81-b118-413a-a5d6-698741e52ca1@googlegroups.com>
Message-ID <EN6dnYRLCKJWDJDNnZ2dnUVZ_vudnZ2d@bestweb.net> (permalink)

Show all headers | View raw


On 7/21/2012 2:37 PM, Malcolm McLean wrote:
> בתאריך יום שבת, 21 ביולי 2012 18:27:33 UTC+1, מאת Bart:
>> Malcolm McLean&qu &lt;malcolm.mclean5@btinternet.com&gt; wrote in
>> message news:5c390903-75bd-477d-a422-592f60a17d19@googlegroups.com...
>>> The compiler has no way of knowing that a cursor position of 3
>>> billion pixels is completely ridiculous.
>>
>> Not completely. A 1 pixel x 3 billion pixel black white image only
>> uses 375MB.
>>
> That's why int should be 64 bits on 64 bit machines.
>
> You could technically have a 3 billion x 1 pixel image on a 32 bit
> machine, but you'll only have one of them in memory at any one time,and
> it can't be a coloured image. But a lot of operating systems won't allow
> such a big array. It's annoying that signed int doesn't handle this case,
> but the situation is rare enough that we can live with it.
>
> Most people with a need to handle such images will move to 64 bit
> operating systems with more memory. If int is 64 bits, the code will work
> without any need for a rewrite.

On the other hand, there's probably more software that assumes that int is 
32 bits which would be "broken"[1] than there would be software as you describe.


[1] "Broken" in the sense that "it ran as designed when given 32-bit int, 
and no longer runs when given 64-bit int".  Whether such software was 
already "broken" is a separate discussion.

-- 
Kenneth Brody

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


Thread

Unsinged types Jase Schick <nospam@nospam.com> - 2012-07-19 20:03 +0000
  Re: Unsinged types Ben Bacarisse <ben.usenet@bsb.me.uk> - 2012-07-19 21:29 +0100
    Re: Unsinged types jacob navia <jacob@spamsink.net> - 2012-07-19 23:15 +0200
  Re: Unsinged types Robert Wessel <robertwessel2@yahoo.com> - 2012-07-19 16:46 -0500
  Re: Unsinged types Ben Pfaff <blp@cs.stanford.edu> - 2012-07-19 15:47 -0700
    Re: Unsinged types Eric Sosman <esosman@ieee-dot-org.invalid> - 2012-07-19 21:06 -0400
      Re: Unsinged types Ben Bacarisse <ben.usenet@bsb.me.uk> - 2012-07-20 02:32 +0100
        Re: Unsinged types Stephen Sprunk <stephen@sprunk.org> - 2012-07-19 21:08 -0500
          Re: Unsinged types Ben Bacarisse <ben.usenet@bsb.me.uk> - 2012-07-20 04:26 +0100
        Re: Unsinged types Eric Sosman <esosman@ieee-dot-org.invalid> - 2012-07-19 22:56 -0400
          Re: Unsinged types Kenneth Brody <kenbrody@spamcop.net> - 2012-07-20 14:57 -0400
          Re: Unsinged types Keith Thompson <kst-u@mib.org> - 2012-07-20 12:36 -0700
      Re: Unsinged types Kenneth Brody <kenbrody@spamcop.net> - 2012-07-20 14:56 -0400
    Re: Unsinged types Seungbeom Kim <musiphil@bawi.org> - 2012-07-20 14:11 -0700
      Re: Unsinged types Eric Sosman <esosman@ieee-dot-org.invalid> - 2012-07-20 17:41 -0400
        Re: Unsinged types Seungbeom Kim <musiphil@bawi.org> - 2012-07-21 14:07 -0700
          Re: Unsinged types "BartC" <bc@freeuk.com> - 2012-07-21 22:26 +0100
          Re: Unsinged types Tim Rentsch <txr@alumni.caltech.edu> - 2012-07-22 00:01 -0700
            Re: Unsinged types "BartC" <bc@freeuk.com> - 2012-07-22 10:37 +0100
              Re: Unsinged types Tim Rentsch <txr@alumni.caltech.edu> - 2012-09-07 11:34 -0700
            Re: Unsinged types gwowen <gwowen@gmail.com> - 2012-07-23 00:06 -0700
              Re: Unsinged types Tim Rentsch <txr@alumni.caltech.edu> - 2012-09-07 11:30 -0700
          Re: Unsinged types Phil Carmody <thefatphil_demunged@yahoo.co.uk> - 2012-07-22 14:29 +0300
            Re: Unsinged types "BartC" <bc@freeuk.com> - 2012-07-22 14:43 +0100
              Re: Unsinged types Phil Carmody <thefatphil_demunged@yahoo.co.uk> - 2012-07-22 19:12 +0300
            Re: Unsinged types Malcolm McLean <malcolm.mclean5@btinternet.com> - 2012-07-22 12:14 -0700
        Re: Unsinged types Tim Rentsch <txr@alumni.caltech.edu> - 2012-07-21 14:57 -0700
  Re: Unsinged types Nick Keighley <nick_keighley_nospam@hotmail.com> - 2012-07-20 00:11 -0700
  Re: Unsinged types Andrew Cooper <amc96@cam.ac.uk> - 2012-07-20 10:00 +0100
    Re: Unsinged types Malcolm McLean <malcolm.mclean5@btinternet.com> - 2012-07-20 23:48 -0700
      Re: Unsinged types Ben Bacarisse <ben.usenet@bsb.me.uk> - 2012-07-21 15:24 +0100
        Re: Unsinged types Malcolm McLean <malcolm.mclean5@btinternet.com> - 2012-07-21 08:53 -0700
          Re: Unsinged types Ben Bacarisse <ben.usenet@bsb.me.uk> - 2012-07-21 17:48 +0100
            Re: Unsinged types Malcolm McLean <malcolm.mclean5@btinternet.com> - 2012-07-21 11:22 -0700
              Re: Unsinged types Ben Bacarisse <ben.usenet@bsb.me.uk> - 2012-07-21 22:35 +0100
                Re: Unsinged types Malcolm McLean <malcolm.mclean5@btinternet.com> - 2012-07-21 14:55 -0700
          Re: Unsinged types "BartC" <bc@freeuk.com> - 2012-07-21 18:27 +0100
            Re: Unsinged types Malcolm McLean <malcolm.mclean5@btinternet.com> - 2012-07-21 11:37 -0700
              Re: Unsinged types Kenneth Brody <kenbrody@spamcop.net> - 2012-07-23 14:02 -0400
                Re: Unsinged types Malcolm McLean <malcolm.mclean5@btinternet.com> - 2012-07-23 12:21 -0700
                Re: Unsinged types pete <pfiland@mindspring.com> - 2012-07-23 23:57 -0400
  Re: Unsinged types "Bill Leary" <Bill_Leary@msn.com> - 2012-07-20 20:21 -0400
  Re: Unsinged types "io_x" <a@b.c.invalid> - 2012-07-22 10:36 +0200

csiph-web