[M3devel] size_t?
Tony Hosking
hosking at cs.purdue.edu
Mon Feb 11 23:04:10 CET 2008
Sorry.
They belong in Cstddef.i3. size_t is already there. Let's try to
stick to the C ".h" structure.
size_t = INTEGER.
On Feb 11, 2008, at 4:51 PM, Jay wrote:
> > These are OS-dependent! They should not be in BasicCtypes.
>
> 1) There is no Utypes on Windows.
> These are very basic types that belong at a very low level.
> In C++ for example, size_t is provided "automatically" by the
> compiler, no header is needed.
>
> 2) Are they really OS dependent? What OS makes my definitions wrong?
> On what 32 bit architecture is size_t not an unsigned 32 bit
> integer and ptrdiff_t not a signed 32 bit integer?
> Ditto for 64 bit.
> These should always be the same size as a pointer and with the
> proper signedness.
> Even if some of the *.i3 files make size_t = int, is that really
> correct?
> And, I assume int vs. long issue is not an issue here.
> Though they may be different types in C and C++, they need not be
> in Modula-3 (when they are the same size, of course)
>
> - Jay
>
>
>
> > CC: m3devel at elegosoft.com
> > From: hosking at cs.purdue.edu
> > Subject: Re: [M3devel] size_t?
> > Date: Mon, 11 Feb 2008 11:38:48 -0500
> > To: jayk123 at hotmail.com
> >
> >
> > On Feb 11, 2008, at 6:23 AM, Jay wrote:
> >
> > > C:\dev2\cm3.2\m3-libs\m3core\src\C\Common\Cstddef.i3(12): size_t =
> > > INTEGER;
> > >
> > > really? it is signed?
> > > and we are sure this is going to be 64 bits on 64 bit targets?
> > >
> > > size_t and ptrdiff_t ought to be in BasicCtypes, right?
> > > That has a 32 bit and 64 bit version, at least.
> >
> > These are OS-dependent! They should not be in BasicCtypes.
> >
> > >
> > >
> > > Does INTEGER effectively equal int or ptrdiff_t?
> > >
> > > - Jay
>
> Need to know the score, the latest news, or you need your Hotmail®-
> get your "fix". Check it out.
More information about the M3devel
mailing list