[M3devel] INTEGER

Mika Nystrom mika at async.async.caltech.edu
Sun Apr 18 04:35:35 CEST 2010


Ok, sorry if I am beating a dead horse here.

What is INTEGER on a 64-bit machine?  

Modula-3 doesn't specify it to be one or the other does it?
But normally, 64 bits?

I am asking because I was looking through some stub generator code,
and I'm really wondering about the LONGINT.  Now there are "longcard"
things showing up, which means another set of changes to a lot of code.

The rationale for LONGINT is, again?

We need it to match 64-bit integers on 32-bit machines?  That seems like
a very weak rationale indeed, if the same functionality could be provided
through some other mechanism (e.g., ARRAY [0..1] OF INTEGER---even with
a pragma e.g. <*CLONGLONG*>.. if it is necessary to tell the compiler that
a special linkage convention is needed).

On a 64-bit machine INTEGER and CARDINAL are 64/63 bits (right?), so
there is really no need for LONGINT there.

And having an array with a LONGINT index seems silly since you can't
address more memory than you can fit in an INTEGER anyhow...

    Mika

>________________________________
>From: hosking at cs.purdue.edu
>Date: Thu, 15 Apr 2010 12:55:52 -0400
>To: jay.krell at cornell.edu
>CC: m3devel at elegosoft.com
>Subject: Re: [M3devel] Modula-3/C interop in Date/Time?
>Excepting that INTEGER is not the same as int on 64-bit platforms.
>
>Antony Hosking | Associate Professor | Computer Science | Purdue University
>305 N. University Street | West Lafayette | IN 47907 | USA
>Office +1 765 494 6001 | Mobile +1 765 427 5484
>
>
>
>
>On 15 Apr 2010, at 02:45, Jay K wrote:
>
>Is this legal/correct?
>
>
>Date.i3:
>TYPE TimeZone <: REFANY;
>VAR Local, UTC: TimeZone; (* granted, will maybe change these to extern *)
>
>
>Date.m3:=1B$B!!=1B(B
>REVEAL TimeZone =3D BRANDED "Date.TimeZone" REF INTEGER;
>=1B$B!!=1B(B
>
>DatePosixC.c:
>static const int Local =3D 0;
>static const int UTC =3D 1;
>extern const int const * const Date__Local =3D &Local;
>extern const int const * const Date__UTC =3D &UTC;
>=1B$B!!=1B(B
>
>- Jay



More information about the M3devel mailing list