🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.modula2
Article #2525

Re: Modula-2, Modula-3, C or C++

#2525
From: Richard G. Hash
Date: Fri, 22 Sep 1995 13:18
24 lines
1932 bytes
In <43jsfd$1ea@nntp.nta.no> ohk@hal.nta.no (Ole-Hjalmar Kristensen TF.E/DELAB) writes:
> Btw, I don't particulary like the lack of specification of basic types like int,
> short, etc. in C/C++ either, and Ada isn't much better, which we discovered when
> using a validated Ada compiler which only had 16 bit int's, even though the CPU
> on which it was running had a 32 bit CPU!
> 
> Ole-Hj. Kristensen

So what you really mean is that the implementation of Ada that you had isn't much
better. Don't blame an entire language for the sins of a single lousy compiler!
In general, you can specify your layout quite precisely in Ada, and if the compiler
cannot handle it, you'll find out at compile-time. If you wanted to guarantee
exactly 32 bits ints on every platform you ported to, you should have defined your
own Int32 type, like:
   Int_Last : constant := 2 ** 31 -1;
   Int_First : constant := -Int_Last;
   type Int32 is range Int_first .. Int_last;
If your compiler could not comply you'll find out at compile time. (Sounds like
you need a better compiler, there are lots out there.)

--
Richard G. Hash        phone: (713) 245-731          email: rgh@shell.com
Subsurface Information Technology Services, Shell Services Company
When in trouble or in doubt, run in circles, scream and shout.
Technical Details
Message-ID: <rgh.811775925@camo>
Path: arc1-ca.pugleaf.net!in1.uu.net!pipeline!psinntp!psinntp!psinntp!shellgate!camo!rgh
References: <438nkr$bd@classic.eng.octel.com> <4395o4$3mv2@news-s01.ny.us.ibm.net> <43bdus$l2g@nntp.nta.no> <BLUME.95Sep15102347@dynamic.cs.princeton.edu> <43jsfd$1ea@nntp.nta.no>

Show Full Headers
Complete Article Headers
Newsgroups: comp.lang.modula2,comp.lang.modula3,comp.lang.c,comp.lang.c++
Path: arc1-ca.pugleaf.net!in1.uu.net!pipeline!psinntp!psinntp!psinntp!shellgate!camo!rgh
From: Richard G. Hash <rgh@shell.com>
Subject: Re: Modula-2, Modula-3, C or C++
Message-ID: <rgh.811775925@camo>
Sender: usenet@shellgate.shell.com (USENET News System)
Reply-To: rgh@shell.com
Organization: Shell Bellaire Research Center
References: <438nkr$bd@classic.eng.octel.com> <4395o4$3mv2@news-s01.ny.us.ibm.net>  <43bdus$l2g@nntp.nta.no> <BLUME.95Sep15102347@dynamic.cs.princeton.edu> <43jsfd$1ea@nntp.nta.no>
Date: Fri, 22 Sep 1995 13:18:45 GMT