Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

To be is to program.


devel / comp.lang.c / remark on defining size of basic types

SubjectAuthor
* remark on defining size of basic typesfir
`* Re: remark on defining size of basic typesLawrence D'Oliveiro
 `* Re: remark on defining size of basic typesfir
  `* Re: remark on defining size of basic typesLawrence D'Oliveiro
   `* Re: remark on defining size of basic typesfir
    `* Re: remark on defining size of basic typesJanis Papanagnou
     +* Re: remark on defining size of basic typesJames Kuyper
     |`* Re: remark on defining size of basic typesMichael S
     | +- Re: remark on defining size of basic typesKeith Thompson
     | +* Re: remark on defining size of basic typesJanis Papanagnou
     | |`- Re: remark on defining size of basic typesJames Kuyper
     | `* Re: remark on defining size of basic typesJames Kuyper
     |  `- Re: remark on defining size of basic typesKeith Thompson
     `* Re: remark on defining size of basic typesLawrence D'Oliveiro
      +* Re: remark on defining size of basic typesJanis Papanagnou
      |`* Re: remark on defining size of basic typesLawrence D'Oliveiro
      | `* Re: remark on defining size of basic typesJanis Papanagnou
      |  `* Re: remark on defining size of basic typesLawrence D'Oliveiro
      |   `* Re: remark on defining size of basic typesMichael S
      |    `- Re: remark on defining size of basic typesKeith Thompson
      `- Re: remark on defining size of basic typesKenny McCormack

1
remark on defining size of basic types

<uukp2q$2v3$1@i2pn2.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=34915&group=comp.lang.c#34915

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!.POSTED!not-for-mail
From: fir...@grunge.pl (fir)
Newsgroups: comp.lang.c
Subject: remark on defining size of basic types
Date: Thu, 04 Apr 2024 01:34:48 +0200
Organization: i2pn2 (i2pn.org)
Message-ID: <uukp2q$2v3$1@i2pn2.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 3 Apr 2024 23:34:50 -0000 (UTC)
Injection-Info: i2pn2.org;
logging-data="3043"; mail-complaints-to="usenet@i2pn2.org";
posting-account="+ydHcGjgSeBt3Wz3WTfKefUptpAWaXduqfw5xdfsuS0";
User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:27.0) Gecko/20100101 Firefox/27.0 SeaMonkey/2.24
X-Spam-Checker-Version: SpamAssassin 4.0.0
 by: fir - Wed, 3 Apr 2024 23:34 UTC

here is a problem in using 64 big ints on windows
(at least to me its a problem - there are few options
etc, being not sure how it works etc) and how much
more easy and good it would be if long would just have 64
bits

the conclusion is - whouldnt just compilers offer
a way of defining it how long long int shorts
are ? imo it should be much better andportability of
codes probably would be increased

Re: remark on defining size of basic types

<uukrfp$7l0f$2@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=34916&group=comp.lang.c#34916

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo...@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.lang.c
Subject: Re: remark on defining size of basic types
Date: Thu, 4 Apr 2024 00:15:54 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 10
Message-ID: <uukrfp$7l0f$2@dont-email.me>
References: <uukp2q$2v3$1@i2pn2.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 04 Apr 2024 00:15:54 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="b2ebab76618f2906d24b8f2b6b05668a";
logging-data="250895"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/EA9wVITU5WjRZ0RW52m/O"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:hOMEiGD1L3+6OIRKpDSkIYS2urc=
 by: Lawrence D'Oliv - Thu, 4 Apr 2024 00:15 UTC

On Thu, 04 Apr 2024 01:34:48 +0200, fir wrote:

> here is a problem in using 64 big ints on windows ...

#include <stdint.h>

int64_t signed_64bit_int;
uint64_t unsigned_64bit_int;

Re: remark on defining size of basic types

<uul0q6$c4i$1@i2pn2.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=34917&group=comp.lang.c#34917

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!.POSTED!not-for-mail
From: fir...@grunge.pl (fir)
Newsgroups: comp.lang.c
Subject: Re: remark on defining size of basic types
Date: Thu, 04 Apr 2024 03:46:46 +0200
Organization: i2pn2 (i2pn.org)
Message-ID: <uul0q6$c4i$1@i2pn2.org>
References: <uukp2q$2v3$1@i2pn2.org> <uukrfp$7l0f$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 4 Apr 2024 01:46:47 -0000 (UTC)
Injection-Info: i2pn2.org;
logging-data="12434"; mail-complaints-to="usenet@i2pn2.org";
posting-account="+ydHcGjgSeBt3Wz3WTfKefUptpAWaXduqfw5xdfsuS0";
User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:27.0) Gecko/20100101 Firefox/27.0 SeaMonkey/2.24
X-Spam-Checker-Version: SpamAssassin 4.0.0
In-Reply-To: <uukrfp$7l0f$2@dont-email.me>
 by: fir - Thu, 4 Apr 2024 01:46 UTC

Lawrence D'Oliveiro wrote:
> On Thu, 04 Apr 2024 01:34:48 +0200, fir wrote:
>
>> here is a problem in using 64 big ints on windows ...
>
> #include <stdint.h>
>
> int64_t signed_64bit_int;
> uint64_t unsigned_64bit_int;
>
>
maybe but thats not the point
i mean if types (like int.long) vary on different machines
and programmers use them - wouldnt it to be better to
allow redefine them like in compiler commandline
liek -long=64 -long=32 , something like that?

(i find it as not much interesting remark, but wonder it that wouldnt be
more logical)

Re: remark on defining size of basic types

<uul461$d88r$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=34918&group=comp.lang.c#34918

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo...@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.lang.c
Subject: Re: remark on defining size of basic types
Date: Thu, 4 Apr 2024 02:44:17 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 17
Message-ID: <uul461$d88r$1@dont-email.me>
References: <uukp2q$2v3$1@i2pn2.org> <uukrfp$7l0f$2@dont-email.me>
<uul0q6$c4i$1@i2pn2.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 04 Apr 2024 02:44:17 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="b2ebab76618f2906d24b8f2b6b05668a";
logging-data="434459"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/j8ezt3eqSDdeahvSzHt1E"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:ACHmhy4Ohd0+9j1jUgfYMJxE3U0=
 by: Lawrence D'Oliv - Thu, 4 Apr 2024 02:44 UTC

On Thu, 04 Apr 2024 03:46:46 +0200, fir wrote:

> Lawrence D'Oliveiro wrote:
>
>> On Thu, 04 Apr 2024 01:34:48 +0200, fir wrote:
>>
>>> here is a problem in using 64 big ints on windows ...
>>
>> #include <stdint.h>
>>
>> int64_t signed_64bit_int;
>> uint64_t unsigned_64bit_int;
>>
> maybe but thats not the point

If you want specific-sized types, that’s the standard C mechanism for
providing them.

Re: remark on defining size of basic types

<uum354$1l27$1@i2pn2.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=34919&group=comp.lang.c#34919

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!.POSTED!not-for-mail
From: fir...@grunge.pl (fir)
Newsgroups: comp.lang.c
Subject: Re: remark on defining size of basic types
Date: Thu, 04 Apr 2024 13:32:52 +0200
Organization: i2pn2 (i2pn.org)
Message-ID: <uum354$1l27$1@i2pn2.org>
References: <uukp2q$2v3$1@i2pn2.org> <uukrfp$7l0f$2@dont-email.me> <uul0q6$c4i$1@i2pn2.org> <uul461$d88r$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 4 Apr 2024 11:32:52 -0000 (UTC)
Injection-Info: i2pn2.org;
logging-data="54343"; mail-complaints-to="usenet@i2pn2.org";
posting-account="+ydHcGjgSeBt3Wz3WTfKefUptpAWaXduqfw5xdfsuS0";
User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:27.0) Gecko/20100101 Firefox/27.0 SeaMonkey/2.24
In-Reply-To: <uul461$d88r$1@dont-email.me>
X-Spam-Checker-Version: SpamAssassin 4.0.0
 by: fir - Thu, 4 Apr 2024 11:32 UTC

Lawrence D'Oliveiro wrote:
> On Thu, 04 Apr 2024 03:46:46 +0200, fir wrote:
>
>> Lawrence D'Oliveiro wrote:
>>
>>> On Thu, 04 Apr 2024 01:34:48 +0200, fir wrote:
>>>
>>>> here is a problem in using 64 big ints on windows ...
>>>
>>> #include <stdint.h>
>>>
>>> int64_t signed_64bit_int;
>>> uint64_t unsigned_64bit_int;
>>>
>> maybe but thats not the point
>
> If you want specific-sized types, that’s the standard C mechanism for
> providing them.
>
ok, but my point is maybe the convention to use that standard ones char
short int long and allowing them to be set (overwiitting defaults) from
the command line would/wouldnt be just better

someone can think here what they want, but i just wanted to pint that
idea (for eventuall discussion if someone wants)

Re: remark on defining size of basic types

<uum95f$lr8o$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=34920&group=comp.lang.c#34920

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: janis_pa...@hotmail.com (Janis Papanagnou)
Newsgroups: comp.lang.c
Subject: Re: remark on defining size of basic types
Date: Thu, 4 Apr 2024 15:15:26 +0200
Organization: A noiseless patient Spider
Lines: 43
Message-ID: <uum95f$lr8o$1@dont-email.me>
References: <uukp2q$2v3$1@i2pn2.org> <uukrfp$7l0f$2@dont-email.me>
<uul0q6$c4i$1@i2pn2.org> <uul461$d88r$1@dont-email.me>
<uum354$1l27$1@i2pn2.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 04 Apr 2024 13:15:28 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="c5ff4addef5df3c6c5e8cad97f352037";
logging-data="716056"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/e2ISJ5Y/ASfjDeRnYZYPx"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
Thunderbird/45.8.0
Cancel-Lock: sha1:KMx9aXgryxTHZeoPzY7FutNk8IQ=
X-Enigmail-Draft-Status: N1110
In-Reply-To: <uum354$1l27$1@i2pn2.org>
 by: Janis Papanagnou - Thu, 4 Apr 2024 13:15 UTC

On 04.04.2024 13:32, fir wrote:
> Lawrence D'Oliveiro wrote:
>> On Thu, 04 Apr 2024 03:46:46 +0200, fir wrote:
>>
>>> Lawrence D'Oliveiro wrote:
>>>
>>>> On Thu, 04 Apr 2024 01:34:48 +0200, fir wrote:
>>>>
>>>>> here is a problem in using 64 big ints on windows ...
>>>>
>>>> #include <stdint.h>
>>>>
>>>> int64_t signed_64bit_int;
>>>> uint64_t unsigned_64bit_int;
>>>>
>>> maybe but thats not the point
>>
>> If you want specific-sized types, that’s the standard C mechanism for
>> providing them.
>>
> ok, but my point is maybe the convention to use that standard ones char
> short int long and allowing them to be set (overwiitting defaults) from
> the command line would/wouldnt be just better
>
> someone can think here what they want, but i just wanted to pint that
> idea (for eventuall discussion if someone wants)

*If* the size matters you should/could use the sized data types that
you see above. If size doesn't matter, why redefine the basic types?

Since I remember C had always just defined a '<=' (or '>=') relation
between the unsized basic integral data types.

You may want to explain what (positive) effect you expect from such
a language change or feature. (And consider what drawbacks and issues
would be accompanied with it.)

Sometimes it's useful to have an unbounded or parameterized integral
data type available - this is what I initially thought your thread
might be about - and some language (not C) do support that.

Janis

Re: remark on defining size of basic types

<uumiu8$o78i$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=34922&group=comp.lang.c#34922

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: jameskuy...@alumni.caltech.edu (James Kuyper)
Newsgroups: comp.lang.c
Subject: Re: remark on defining size of basic types
Date: Thu, 4 Apr 2024 12:02:16 -0400
Organization: A noiseless patient Spider
Lines: 21
Message-ID: <uumiu8$o78i$1@dont-email.me>
References: <uukp2q$2v3$1@i2pn2.org> <uukrfp$7l0f$2@dont-email.me>
<uul0q6$c4i$1@i2pn2.org> <uul461$d88r$1@dont-email.me>
<uum354$1l27$1@i2pn2.org> <uum95f$lr8o$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 04 Apr 2024 16:02:17 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="0f535587ed0cce5386e66a52273f2426";
logging-data="793874"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18djAlRXrNl1xFY/onmiCKo7ld3leRQdjA="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:84Htv2jX1hJCfmfDGNUiXRKHOdk=
Content-Language: en-US
In-Reply-To: <uum95f$lr8o$1@dont-email.me>
 by: James Kuyper - Thu, 4 Apr 2024 16:02 UTC

On 4/4/24 09:15, Janis Papanagnou wrote:
....
> Since I remember C had always just defined a '<=' (or '>=') relation
> between the unsized basic integral data types.

There's several things not quite right about the form of that sentence,
so I'm not quite sure what you meant to say, but C originally defined
the relational operators for any arithmetic type (and for pointers to
compatible object types), including the unsigned types..

Some complications have been added since then. When extended integer
types and _Bool were added, the definitions were adjusted so that the
integer promotion rules apply to _Bool, and extended integer types are
included along with other integer types. When _Complex and _Imaginary
were added, the operands to the relational operators were explicitly
required to be real (which, as C defines the term, includes all integer
types). When decimal floating types were introduced, they added a
prohibition on comparing such values with values that had a standard
floating types. However, nothing matching the restrictions you imply has
ever been true.

Re: remark on defining size of basic types

<20240404200454.00003811@yahoo.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=34924&group=comp.lang.c#34924

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: already5...@yahoo.com (Michael S)
Newsgroups: comp.lang.c
Subject: Re: remark on defining size of basic types
Date: Thu, 4 Apr 2024 20:04:54 +0300
Organization: A noiseless patient Spider
Lines: 29
Message-ID: <20240404200454.00003811@yahoo.com>
References: <uukp2q$2v3$1@i2pn2.org>
<uukrfp$7l0f$2@dont-email.me>
<uul0q6$c4i$1@i2pn2.org>
<uul461$d88r$1@dont-email.me>
<uum354$1l27$1@i2pn2.org>
<uum95f$lr8o$1@dont-email.me>
<uumiu8$o78i$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 04 Apr 2024 17:05:00 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="12b418826dd2f4b5860a6017a4044401";
logging-data="826791"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+1/okv08Un8jEDJPahWsnMgr7RaQVSlFg="
Cancel-Lock: sha1:CQzF4JX+MWJb5RO8D2JLU1gORVo=
X-Newsreader: Claws Mail 3.19.1 (GTK+ 2.24.33; x86_64-w64-mingw32)
 by: Michael S - Thu, 4 Apr 2024 17:04 UTC

On Thu, 4 Apr 2024 12:02:16 -0400
James Kuyper <jameskuyper@alumni.caltech.edu> wrote:

> On 4/4/24 09:15, Janis Papanagnou wrote:
> ...
> > Since I remember C had always just defined a '<=' (or '>=') relation
> > between the unsized basic integral data types.
>
> There's several things not quite right about the form of that
> sentence, so I'm not quite sure what you meant to say, but C
> originally defined the relational operators for any arithmetic type
> (and for pointers to compatible object types), including the unsigned
> types..
>
> Some complications have been added since then. When extended integer
> types and _Bool were added, the definitions were adjusted so that the
> integer promotion rules apply to _Bool, and extended integer types are
> included along with other integer types. When _Complex and _Imaginary
> were added, the operands to the relational operators were explicitly
> required to be real (which, as C defines the term, includes all
> integer types). When decimal floating types were introduced, they
> added a prohibition on comparing such values with values that had a
> standard floating types. However, nothing matching the restrictions
> you imply has ever been true.
>

He meant sizeof(short) <= sizeof(int) <= sizeof(long) <= sizeof(long
long)

Re: remark on defining size of basic types

<874jcgkhxz.fsf@nosuchdomain.example.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=34925&group=comp.lang.c#34925

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!news.hispagatos.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Keith.S....@gmail.com (Keith Thompson)
Newsgroups: comp.lang.c
Subject: Re: remark on defining size of basic types
Date: Thu, 04 Apr 2024 13:10:16 -0700
Organization: None to speak of
Lines: 14
Message-ID: <874jcgkhxz.fsf@nosuchdomain.example.com>
References: <uukp2q$2v3$1@i2pn2.org> <uukrfp$7l0f$2@dont-email.me>
<uul0q6$c4i$1@i2pn2.org> <uul461$d88r$1@dont-email.me>
<uum354$1l27$1@i2pn2.org> <uum95f$lr8o$1@dont-email.me>
<uumiu8$o78i$1@dont-email.me> <20240404200454.00003811@yahoo.com>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Date: Thu, 04 Apr 2024 20:10:16 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="a676ed97fbdb727a614d232e40193eaf";
logging-data="911212"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18C5HolgYpfJEuEiyXTWEFt"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
Cancel-Lock: sha1:L0u04Q+FX21rVOUQqTcvOITcv6A=
sha1:LHlbRLXQh7u11AR+FysyhTgSUyY=
 by: Keith Thompson - Thu, 4 Apr 2024 20:10 UTC

Michael S <already5chosen@yahoo.com> writes:
[...]
> He meant sizeof(short) <= sizeof(int) <= sizeof(long) <= sizeof(long
> long)

Which isn't *strictly* true. The relationships are defined in terms of
ranges, so for example INT_MAX <= LONG_MAX. A weird but conforming
implementation with padding bits could have sizeof (int) > sizeof
(long). (As far as I know no such implementation exists.)

--
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
Working, but not speaking, for Medtronic
void Void(void) { Void(); } /* The recursive call of the void */

Re: remark on defining size of basic types

<uundl9$ugsb$2@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=34927&group=comp.lang.c#34927

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo...@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.lang.c
Subject: Re: remark on defining size of basic types
Date: Thu, 4 Apr 2024 23:38:18 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 6
Message-ID: <uundl9$ugsb$2@dont-email.me>
References: <uukp2q$2v3$1@i2pn2.org> <uukrfp$7l0f$2@dont-email.me>
<uul0q6$c4i$1@i2pn2.org> <uul461$d88r$1@dont-email.me>
<uum354$1l27$1@i2pn2.org> <uum95f$lr8o$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 04 Apr 2024 23:38:18 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="f5e959706a1ab93774d71c78cd2d7e1b";
logging-data="1000331"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+5qPMwL9TMOrbX/A8Eta15"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:fRfSq6EdCSBK1Tutbp/3gpYniMo=
 by: Lawrence D'Oliv - Thu, 4 Apr 2024 23:38 UTC

On Thu, 4 Apr 2024 15:15:26 +0200, Janis Papanagnou wrote:

> Sometimes it's useful to have an unbounded or parameterized integral
> data type available ...

Interestingly, Fortran (of all things) has that.

Re: remark on defining size of basic types

<uunf7c$v0kc$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=34928&group=comp.lang.c#34928

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!news.niel.me!news.gegeweb.eu!gegeweb.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: janis_pa...@hotmail.com (Janis Papanagnou)
Newsgroups: comp.lang.c
Subject: Re: remark on defining size of basic types
Date: Fri, 5 Apr 2024 02:04:59 +0200
Organization: A noiseless patient Spider
Lines: 28
Message-ID: <uunf7c$v0kc$1@dont-email.me>
References: <uukp2q$2v3$1@i2pn2.org> <uukrfp$7l0f$2@dont-email.me>
<uul0q6$c4i$1@i2pn2.org> <uul461$d88r$1@dont-email.me>
<uum354$1l27$1@i2pn2.org> <uum95f$lr8o$1@dont-email.me>
<uumiu8$o78i$1@dont-email.me> <20240404200454.00003811@yahoo.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 05 Apr 2024 00:05:01 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="c6ae584e28bb1589ec681cad79171e32";
logging-data="1016460"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18USpa6gzqL9T8cSSafPmIl"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
Thunderbird/45.8.0
Cancel-Lock: sha1:Yh+Sxq29dDjEF7iNkwb9zv3x1pw=
X-Enigmail-Draft-Status: N1110
In-Reply-To: <20240404200454.00003811@yahoo.com>
 by: Janis Papanagnou - Fri, 5 Apr 2024 00:04 UTC

On 04.04.2024 19:04, Michael S wrote:
> On Thu, 4 Apr 2024 12:02:16 -0400
> James Kuyper <jameskuyper@alumni.caltech.edu> wrote:
>> On 4/4/24 09:15, Janis Papanagnou wrote:
>> ...
>>> Since I remember C had always just defined a '<=' (or '>=') relation
>>> between the unsized basic integral data types.
>>
>> [...]
>
> He meant sizeof(short) <= sizeof(int) <= sizeof(long) <= sizeof(long
> long)

Yes, indeed I meant the size of the data types. The comparison
operators of the _values_ of data types wouldn't quite fit on
the topic at all, or so I thought. (Sorry for potentially bad
wording and any possible misinterpretation.)

I thought I've read about those properties at K&R times, that
these properties would hold, but a quick look into some old C
and UNIX books did not show that; only a comment that 'short'
is not larger than 'long'. But I found it in Stroustrup's C++
language book.

Not sure whether that's formally standardized for C.

Janis

Re: remark on defining size of basic types

<uungdk$v8gp$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=34929&group=comp.lang.c#34929

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: janis_pa...@hotmail.com (Janis Papanagnou)
Newsgroups: comp.lang.c
Subject: Re: remark on defining size of basic types
Date: Fri, 5 Apr 2024 02:25:22 +0200
Organization: A noiseless patient Spider
Lines: 32
Message-ID: <uungdk$v8gp$1@dont-email.me>
References: <uukp2q$2v3$1@i2pn2.org> <uukrfp$7l0f$2@dont-email.me>
<uul0q6$c4i$1@i2pn2.org> <uul461$d88r$1@dont-email.me>
<uum354$1l27$1@i2pn2.org> <uum95f$lr8o$1@dont-email.me>
<uundl9$ugsb$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 05 Apr 2024 00:25:24 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="c6ae584e28bb1589ec681cad79171e32";
logging-data="1024537"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19QK1oa1McPsQ31qiUGHM7W"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
Thunderbird/45.8.0
Cancel-Lock: sha1:gmf6dteFfW3PNbhLDnbZUIodzLw=
In-Reply-To: <uundl9$ugsb$2@dont-email.me>
X-Enigmail-Draft-Status: N1110
 by: Janis Papanagnou - Fri, 5 Apr 2024 00:25 UTC

On 05.04.2024 01:38, Lawrence D'Oliveiro wrote:
> On Thu, 4 Apr 2024 15:15:26 +0200, Janis Papanagnou wrote:
>
>> Sometimes it's useful to have an unbounded or parameterized integral
>> data type available ...
>
> Interestingly, Fortran (of all things) has that.

Was that the e.g. '*8' syntax? - Did it allow arbitrary lengths?
I thought you could select only from few supported ranges (like,
the C scalar types, but declared as *1, *2, *4, *8, and that's
it). (I have only faint memories about Fortran, did not use it
for long.)

In Pascal you could define subranges, but I think also only on a
fixed integral base type, and Ada seems to have a similar concept.

But GNU Awk supports multiple precision arithmetic, optionally.
(No explicit data type, though.)

I'm reluctant[*] to say that I think Cobol[**] as well has such a
feature. And I think it had no size restriction on a machine word
as the other languages mentioned above. - Is that correct?

(That language feature might have got out of fashion long ago?)

Janis

[*] Some folks here might feel offended by mentioning Cobol again.

[**] A language I never programmed myself in.

Re: remark on defining size of basic types

<uunhls$vbtu$2@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=34930&group=comp.lang.c#34930

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo...@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.lang.c
Subject: Re: remark on defining size of basic types
Date: Fri, 5 Apr 2024 00:46:52 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 30
Message-ID: <uunhls$vbtu$2@dont-email.me>
References: <uukp2q$2v3$1@i2pn2.org> <uukrfp$7l0f$2@dont-email.me>
<uul0q6$c4i$1@i2pn2.org> <uul461$d88r$1@dont-email.me>
<uum354$1l27$1@i2pn2.org> <uum95f$lr8o$1@dont-email.me>
<uundl9$ugsb$2@dont-email.me> <uungdk$v8gp$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 05 Apr 2024 00:46:53 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="f5e959706a1ab93774d71c78cd2d7e1b";
logging-data="1028030"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+gRyvdS2nMw/sIL+Bn6+0c"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:XhNELYezDbEm/+eskQUgrmLl+6k=
 by: Lawrence D'Oliv - Fri, 5 Apr 2024 00:46 UTC

On Fri, 5 Apr 2024 02:25:22 +0200, Janis Papanagnou wrote:

> On 05.04.2024 01:38, Lawrence D'Oliveiro wrote:
>
>> On Thu, 4 Apr 2024 15:15:26 +0200, Janis Papanagnou wrote:
>>
>>> Sometimes it's useful to have an unbounded or parameterized integral
>>> data type available ...
>>
>> Interestingly, Fortran (of all things) has that.
>
> Was that the e.g. '*8' syntax? - Did it allow arbitrary lengths?

No, and no. Since Fortran 2003, you can parameterize a custom type
definition with integer values. These can be used to specify the sizes of
arrays, or they can be used as codes for the different (implementation-
defined) precisions of integer and real types. An example from the
language spec:

TYPE :: t1(k1,k2)
INTEGER, KIND :: k1,k2
REAL(k1) a(k2)
END TYPE

This defines a custom type “t1”, which is an array of reals; the first
parameter determines the precision of the reals, and the second one
specifies the length of the array.

There are various query mechanisms (built-in functions, standard modules)
to determine the valid values of the number-precision codes.

Re: remark on defining size of basic types

<uunp8q$3del2$1@news.xmission.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=34931&group=comp.lang.c#34931

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!xmission!nnrp.xmission!.POSTED.shell.xmission.com!not-for-mail
From: gaze...@shell.xmission.com (Kenny McCormack)
Newsgroups: comp.lang.c
Subject: Re: remark on defining size of basic types
Date: Fri, 5 Apr 2024 02:56:26 -0000 (UTC)
Organization: The official candy of the new Millennium
Message-ID: <uunp8q$3del2$1@news.xmission.com>
References: <uukp2q$2v3$1@i2pn2.org> <uum354$1l27$1@i2pn2.org> <uum95f$lr8o$1@dont-email.me> <uundl9$ugsb$2@dont-email.me>
Injection-Date: Fri, 5 Apr 2024 02:56:26 -0000 (UTC)
Injection-Info: news.xmission.com; posting-host="shell.xmission.com:166.70.8.4";
logging-data="3586722"; mail-complaints-to="abuse@xmission.com"
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
Originator: gazelle@shell.xmission.com (Kenny McCormack)
 by: Kenny McCormack - Fri, 5 Apr 2024 02:56 UTC

In article <uundl9$ugsb$2@dont-email.me>,
Lawrence D'Oliveiro <ldo@nz.invalid> wrote:
>On Thu, 4 Apr 2024 15:15:26 +0200, Janis Papanagnou wrote:
>
>> Sometimes it's useful to have an unbounded or parameterized integral
>> data type available ...
>
>Interestingly, Fortran (of all things) has that.

GAWK has it (*) - when run with -M.

(*) Or at least it did. Latest scuttlebut is they might be removing it.

--
Modern Conservative: Someone who can take time out from flashing her
wedding ring around and bragging about her honeymoon to complain that a
fellow secretary who keeps a picture of her girlfriend on her desk is
"flauting her sexuality" and "forcing her lifestyle down our throats".

Re: remark on defining size of basic types

<uunvah$15vot$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=34932&group=comp.lang.c#34932

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: jameskuy...@alumni.caltech.edu (James Kuyper)
Newsgroups: comp.lang.c
Subject: Re: remark on defining size of basic types
Date: Thu, 4 Apr 2024 19:39:00 -0400
Organization: A noiseless patient Spider
Lines: 30
Message-ID: <uunvah$15vot$1@dont-email.me>
References: <uukp2q$2v3$1@i2pn2.org> <uukrfp$7l0f$2@dont-email.me>
<uul0q6$c4i$1@i2pn2.org> <uul461$d88r$1@dont-email.me>
<uum354$1l27$1@i2pn2.org> <uum95f$lr8o$1@dont-email.me>
<uumiu8$o78i$1@dont-email.me> <20240404200454.00003811@yahoo.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 05 Apr 2024 04:39:45 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="eb727b066df0d5a210ecb229d20a2fdf";
logging-data="1244957"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19xTL+W6bfYicnHoUlymJvDY1EKHpSHulA="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:nP9L1jt2vPM37jj8hfqnX29LcAM=
Content-Language: en-US
In-Reply-To: <20240404200454.00003811@yahoo.com>
 by: James Kuyper - Thu, 4 Apr 2024 23:39 UTC

On 4/4/24 13:04, Michael S wrote:
> On Thu, 4 Apr 2024 12:02:16 -0400
> James Kuyper <jameskuyper@alumni.caltech.edu> wrote:
>
>> On 4/4/24 09:15, Janis Papanagnou wrote:
>> ...
>>> Since I remember C had always just defined a '<=' (or '>=') relation
>>> between the unsized basic integral data types.
....
> He meant sizeof(short) <= sizeof(int) <= sizeof(long) <= sizeof(long
> long)

That's not actually the case. In the above, you are not using <= as the
C operator, but simply to indicate relative order over multiple items; I
will do the same. What is specified is equivalent to the following

LONGLONG_MIN <= LONG_MIN <= INT_MIN <= SHORT_MIN <= SCHAR_MAX
SCHAR_MAX <= SHORT_MAX <= INT_MAX <= LONG_MAX <= LONGLONG_MAX
UCHAR_MAX <= USHORT_MAX <= UINT_MAX <= ULONG_MAX <= ULONGLONG_MAX

SCHAR_MAX <= UCHAR_MAX
INT_MAX <= UINT_MAX
LONG_MAX <= ULONG_MAX
LONGLONG_MAX <= ULONGLONG_MAX

The sizes are not required to be in the same order as the maximum
values, nor in the opposite order of the minimum values. If they were in
a different order, it would imply a lot of padding bits, which would be
very odd, but not prohibited.

Re: remark on defining size of basic types

<uunvha$15vot$2@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=34933&group=comp.lang.c#34933

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: jameskuy...@alumni.caltech.edu (James Kuyper)
Newsgroups: comp.lang.c
Subject: Re: remark on defining size of basic types
Date: Fri, 5 Apr 2024 00:43:22 -0400
Organization: A noiseless patient Spider
Lines: 23
Message-ID: <uunvha$15vot$2@dont-email.me>
References: <uukp2q$2v3$1@i2pn2.org> <uukrfp$7l0f$2@dont-email.me>
<uul0q6$c4i$1@i2pn2.org> <uul461$d88r$1@dont-email.me>
<uum354$1l27$1@i2pn2.org> <uum95f$lr8o$1@dont-email.me>
<uumiu8$o78i$1@dont-email.me> <20240404200454.00003811@yahoo.com>
<uunf7c$v0kc$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 05 Apr 2024 04:43:22 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="eb727b066df0d5a210ecb229d20a2fdf";
logging-data="1244957"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+gQGHJ3lSbfZvl0xO3/RZHOl6yrMlZ03Q="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:AqPFiMxTgK4jYOumBxP1diyaBDo=
In-Reply-To: <uunf7c$v0kc$1@dont-email.me>
Content-Language: en-US
 by: James Kuyper - Fri, 5 Apr 2024 04:43 UTC

On 4/4/24 20:04, Janis Papanagnou wrote:
> On 04.04.2024 19:04, Michael S wrote:
....
>> He meant sizeof(short) <= sizeof(int) <= sizeof(long) <= sizeof(long
>> long)
>
> Yes, indeed I meant the size of the data types. The comparison
> operators of the _values_ of data types wouldn't quite fit on
> the topic at all, or so I thought. (Sorry for potentially bad
> wording and any possible misinterpretation.)
>
> I thought I've read about those properties at K&R times, that
> these properties would hold, but a quick look into some old C
> and UNIX books did not show that; only a comment that 'short'
> is not larger than 'long'. But I found it in Stroustrup's C++
> language book.
>
> Not sure whether that's formally standardized for C.

Restrictions on the representable ranges (NOT the sizes) of
various integer types are formally imposed by the standard. My response
to Michael's message lists those restrictions in terms of the limit
macros, though that's not how the standard expresses the requirements.

Re: remark on defining size of basic types

<87zfu8idtc.fsf@nosuchdomain.example.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=34934&group=comp.lang.c#34934

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!news.swapon.de!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Keith.S....@gmail.com (Keith Thompson)
Newsgroups: comp.lang.c
Subject: Re: remark on defining size of basic types
Date: Thu, 04 Apr 2024 22:22:23 -0700
Organization: None to speak of
Lines: 50
Message-ID: <87zfu8idtc.fsf@nosuchdomain.example.com>
References: <uukp2q$2v3$1@i2pn2.org> <uukrfp$7l0f$2@dont-email.me>
<uul0q6$c4i$1@i2pn2.org> <uul461$d88r$1@dont-email.me>
<uum354$1l27$1@i2pn2.org> <uum95f$lr8o$1@dont-email.me>
<uumiu8$o78i$1@dont-email.me> <20240404200454.00003811@yahoo.com>
<uunvah$15vot$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Date: Fri, 05 Apr 2024 05:22:27 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="fec0c29a47b22dfbebf6304061a8ab80";
logging-data="1264067"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/WB6QesRHNr+3QWtYIDl+2"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
Cancel-Lock: sha1:f6LzwomdmGfkjriTIaIo0PbszQ8=
sha1:/YBvPGbRquxU/EWrjac8/KHNWv0=
 by: Keith Thompson - Fri, 5 Apr 2024 05:22 UTC

James Kuyper <jameskuyper@alumni.caltech.edu> writes:
> On 4/4/24 13:04, Michael S wrote:
>> On Thu, 4 Apr 2024 12:02:16 -0400
>> James Kuyper <jameskuyper@alumni.caltech.edu> wrote:
>>
>>> On 4/4/24 09:15, Janis Papanagnou wrote:
>>> ...
>>>> Since I remember C had always just defined a '<=' (or '>=') relation
>>>> between the unsized basic integral data types.
> ...
>> He meant sizeof(short) <= sizeof(int) <= sizeof(long) <= sizeof(long
>> long)
>
> That's not actually the case. In the above, you are not using <= as the
> C operator, but simply to indicate relative order over multiple items; I
> will do the same. What is specified is equivalent to the following
>
> LONGLONG_MIN <= LONG_MIN <= INT_MIN <= SHORT_MIN <= SCHAR_MAX
> SCHAR_MAX <= SHORT_MAX <= INT_MAX <= LONG_MAX <= LONGLONG_MAX
> UCHAR_MAX <= USHORT_MAX <= UINT_MAX <= ULONG_MAX <= ULONGLONG_MAX
>
> SCHAR_MAX <= UCHAR_MAX
> INT_MAX <= UINT_MAX
> LONG_MAX <= ULONG_MAX
> LONGLONG_MAX <= ULONGLONG_MAX

SHRT, not SHORT.
LLONG, not LONGLONG.

> The sizes are not required to be in the same order as the maximum
> values, nor in the opposite order of the minimum values. If they were in
> a different order, it would imply a lot of padding bits, which would be
> very odd, but not prohibited.

For completeness, the way it's described in the standard (quoting N3220
6.2.5p10-11) is :

For any two integer types with the same signedness and different
integer conversion rank (see 6.3.1.1), the range of values of the
type with smaller integer conversion rank is a subrange of the
values of the other type.

The range of nonnegative values of a signed integer type is a
subrange of the corresponding unsigned integer type, and the
representation of the same value in each type is the same.

--
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
Working, but not speaking, for Medtronic
void Void(void) { Void(); } /* The recursive call of the void */

Re: remark on defining size of basic types

<uuo5pp$17d43$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=34935&group=comp.lang.c#34935

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: janis_pa...@hotmail.com (Janis Papanagnou)
Newsgroups: comp.lang.c
Subject: Re: remark on defining size of basic types
Date: Fri, 5 Apr 2024 08:30:16 +0200
Organization: A noiseless patient Spider
Lines: 49
Message-ID: <uuo5pp$17d43$1@dont-email.me>
References: <uukp2q$2v3$1@i2pn2.org> <uukrfp$7l0f$2@dont-email.me>
<uul0q6$c4i$1@i2pn2.org> <uul461$d88r$1@dont-email.me>
<uum354$1l27$1@i2pn2.org> <uum95f$lr8o$1@dont-email.me>
<uundl9$ugsb$2@dont-email.me> <uungdk$v8gp$1@dont-email.me>
<uunhls$vbtu$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 05 Apr 2024 06:30:18 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="215b01864d86808d57fa86caa48834e5";
logging-data="1291395"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18u2hc/bk6bi7Sw7/zSXJ3r"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
Thunderbird/45.8.0
Cancel-Lock: sha1:jBGMuMEUCbpZZVVhtTJLqeF6P0Y=
X-Enigmail-Draft-Status: N1110
In-Reply-To: <uunhls$vbtu$2@dont-email.me>
 by: Janis Papanagnou - Fri, 5 Apr 2024 06:30 UTC

On 05.04.2024 02:46, Lawrence D'Oliveiro wrote:
> On Fri, 5 Apr 2024 02:25:22 +0200, Janis Papanagnou wrote:
>
>> On 05.04.2024 01:38, Lawrence D'Oliveiro wrote:
>>
>>> On Thu, 4 Apr 2024 15:15:26 +0200, Janis Papanagnou wrote:
>>>
>>>> Sometimes it's useful to have an unbounded or parameterized integral
>>>> data type available ...
>>>
>>> Interestingly, Fortran (of all things) has that.
>>
>> Was that the e.g. '*8' syntax? - Did it allow arbitrary lengths?
>
> No, and no. Since Fortran 2003, [...]

For the first question I thought you were referring to old Fortran
versions - I certainly was referring to that syntax, and I see that
my memories were correct -, where you can find types like INTEGER*1,
INTEGER*2, INTEGER*5, INTEGER*8 (see e.g. [*], Table 11 on page 17).

[*] https://docs.nvidia.com/hpc-sdk/pgi-compilers/17.9/pdf/pgi17fortref.pdf

> you can parameterize a custom type
> definition with integer values. These can be used to specify the sizes of
> arrays, or they can be used as codes for the different (implementation-
> defined) precisions of integer and real types. An example from the
> language spec:
>
> TYPE :: t1(k1,k2)
> INTEGER, KIND :: k1,k2
> REAL(k1) a(k2)
> END TYPE
>
> This defines a custom type “t1”, which is an array of reals; the first
> parameter determines the precision of the reals, and the second one
> specifies the length of the array.
>
> There are various query mechanisms (built-in functions, standard modules)
> to determine the valid values of the number-precision codes.

Yes, but I read that 'KIND' specification as a readable variant
of the old syntax where you can also just select between a couple
standard sizes for integers (like SHORT, LONG, etc.).

(But I'm not much interested in Fortran, and we're off-topic.)

Janis

Re: remark on defining size of basic types

<uuo8jg$183rs$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=34936&group=comp.lang.c#34936

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo...@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.lang.c
Subject: Re: remark on defining size of basic types
Date: Fri, 5 Apr 2024 07:18:09 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 16
Message-ID: <uuo8jg$183rs$1@dont-email.me>
References: <uukp2q$2v3$1@i2pn2.org> <uukrfp$7l0f$2@dont-email.me>
<uul0q6$c4i$1@i2pn2.org> <uul461$d88r$1@dont-email.me>
<uum354$1l27$1@i2pn2.org> <uum95f$lr8o$1@dont-email.me>
<uundl9$ugsb$2@dont-email.me> <uungdk$v8gp$1@dont-email.me>
<uunhls$vbtu$2@dont-email.me> <uuo5pp$17d43$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 05 Apr 2024 07:18:09 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="f5e959706a1ab93774d71c78cd2d7e1b";
logging-data="1314684"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19juyBhm4K+kgen88HCM2Sh"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:kkChbtMEeK5ffjUquEcIA0c7aSA=
 by: Lawrence D'Oliv - Fri, 5 Apr 2024 07:18 UTC

On Fri, 5 Apr 2024 08:30:16 +0200, Janis Papanagnou wrote:

> For the first question I thought you were referring to old Fortran
> versions ...

I did say “has”, not “had”.

> Yes, but I read that 'KIND' specification as a readable variant of the
> old syntax ...

It’s parameterizable. That means it is easy to change the precision of the
type right through your code just by altering one definition.

Also, KIND participates in function overloading. That requires it to be
compile-time constant. There are also LEN parameters, which can be
dynamic, but can only be used to size arrays and strings.

Re: remark on defining size of basic types

<20240405171926.000067da@yahoo.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=34938&group=comp.lang.c#34938

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: already5...@yahoo.com (Michael S)
Newsgroups: comp.lang.c
Subject: Re: remark on defining size of basic types
Date: Fri, 5 Apr 2024 17:19:26 +0300
Organization: A noiseless patient Spider
Lines: 30
Message-ID: <20240405171926.000067da@yahoo.com>
References: <uukp2q$2v3$1@i2pn2.org>
<uukrfp$7l0f$2@dont-email.me>
<uul0q6$c4i$1@i2pn2.org>
<uul461$d88r$1@dont-email.me>
<uum354$1l27$1@i2pn2.org>
<uum95f$lr8o$1@dont-email.me>
<uundl9$ugsb$2@dont-email.me>
<uungdk$v8gp$1@dont-email.me>
<uunhls$vbtu$2@dont-email.me>
<uuo5pp$17d43$1@dont-email.me>
<uuo8jg$183rs$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Injection-Date: Fri, 05 Apr 2024 14:19:31 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="7aa75bcf4641487361ea6e6c636dc768";
logging-data="1495609"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/THkG/HQbBADXEy9I8BqbBTFyF6oyTHEo="
Cancel-Lock: sha1:95dVwDjZ+Ebzz3EK1f2ihib6h70=
X-Newsreader: Claws Mail 4.1.1 (GTK 3.24.34; x86_64-w64-mingw32)
 by: Michael S - Fri, 5 Apr 2024 14:19 UTC

On Fri, 5 Apr 2024 07:18:09 -0000 (UTC)
Lawrence D'Oliveiro <ldo@nz.invalid> wrote:

> On Fri, 5 Apr 2024 08:30:16 +0200, Janis Papanagnou wrote:
>
> > For the first question I thought you were referring to old Fortran
> > versions ...
>
> I did say “has”, not “had”.
>
> > Yes, but I read that 'KIND' specification as a readable variant of
> > the old syntax ...
>
> It’s parameterizable. That means it is easy to change the precision
> of the type right through your code just by altering one definition.
>
> Also, KIND participates in function overloading. That requires it to
> be compile-time constant. There are also LEN parameters, which can be
> dynamic, but can only be used to size arrays and strings.

I still think that Janis asked correct questions and that you answered
misleading answers.
I had never read the Fortran-2003 Standard, however I will be very
surprised if it mandates support for integer types wider than 64 bits
(or 18 decimal digits). I would not be surprised if hard mandate is
even lower, may be only 9 digits.
Also I would be surprised if there are implementations that support
integers that are wider than 128 bits (38 digits).

Re: remark on defining size of basic types

<87plv3hmqw.fsf@nosuchdomain.example.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=34940&group=comp.lang.c#34940

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Keith.S....@gmail.com (Keith Thompson)
Newsgroups: comp.lang.c
Subject: Re: remark on defining size of basic types
Date: Fri, 05 Apr 2024 08:07:03 -0700
Organization: None to speak of
Lines: 47
Message-ID: <87plv3hmqw.fsf@nosuchdomain.example.com>
References: <uukp2q$2v3$1@i2pn2.org> <uukrfp$7l0f$2@dont-email.me>
<uul0q6$c4i$1@i2pn2.org> <uul461$d88r$1@dont-email.me>
<uum354$1l27$1@i2pn2.org> <uum95f$lr8o$1@dont-email.me>
<uundl9$ugsb$2@dont-email.me> <uungdk$v8gp$1@dont-email.me>
<uunhls$vbtu$2@dont-email.me> <uuo5pp$17d43$1@dont-email.me>
<uuo8jg$183rs$1@dont-email.me> <20240405171926.000067da@yahoo.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 05 Apr 2024 15:07:04 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="fec0c29a47b22dfbebf6304061a8ab80";
logging-data="1524879"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19QthqRYNtlTu6sft0MoZrK"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
Cancel-Lock: sha1:+hV6Mwk3+M2MRMCMOUhaER1lk68=
sha1:Ew6eWcf9yNomUbKUNscpkjkjP7Q=
 by: Keith Thompson - Fri, 5 Apr 2024 15:07 UTC

Michael S <already5chosen@yahoo.com> writes:
> On Fri, 5 Apr 2024 07:18:09 -0000 (UTC)
> Lawrence D'Oliveiro <ldo@nz.invalid> wrote:
>
>> On Fri, 5 Apr 2024 08:30:16 +0200, Janis Papanagnou wrote:
>>
>> > For the first question I thought you were referring to old Fortran
>> > versions ...
>>
>> I did say “has”, not “had”.
>>
>> > Yes, but I read that 'KIND' specification as a readable variant of
>> > the old syntax ...
>>
>> It’s parameterizable. That means it is easy to change the precision
>> of the type right through your code just by altering one definition.
>>
>> Also, KIND participates in function overloading. That requires it to
>> be compile-time constant. There are also LEN parameters, which can be
>> dynamic, but can only be used to size arrays and strings.
>
> I still think that Janis asked correct questions and that you answered
> misleading answers.
> I had never read the Fortran-2003 Standard, however I will be very
> surprised if it mandates support for integer types wider than 64 bits
> (or 18 decimal digits). I would not be surprised if hard mandate is
> even lower, may be only 9 digits.
> Also I would be surprised if there are implementations that support
> integers that are wider than 128 bits (38 digits).

I think this was the source of some confusion :

On 05.04.2024 01:38, Lawrence D'Oliveiro wrote:
> On Thu, 4 Apr 2024 15:15:26 +0200, Janis Papanagnou wrote:
>
>> Sometimes it's useful to have an unbounded or parameterized integral
>> data type available ...
>
> Interestingly, Fortran (of all things) has that.

As far as I can tell, Fortran has parameterized integral types, but not
unbounded integral types.

--
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
Working, but not speaking, for Medtronic
void Void(void) { Void(); } /* The recursive call of the void */

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor