Article View: comp.lang.modula2
Article #2533Re: Modula-2, Modula-3, C or C++
From: Ole-Hjalmar Kristensen TF.E/DELA...
Date: Mon, 25 Sep 1995 08:02
Date: Mon, 25 Sep 1995 08:02
33 lines
2546 bytes
2546 bytes
In article <rgh.811775925@camo>, Richard G. Hash <rgh@shell.com> writes: |> 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. Yes, this is what we did. It also meant that we had to redefine every operator, if I remember correctly, and that no library functions which expected an integer would accept our integer. I can see that my post could be taken to mean that we were unable to define our own 32 bit integer, I should have said that the standard integer was only 16 bits, although it ran on a 32 bit machine. The compiler was validated, and as you say, the Ada language does not specify the number of bits in an integer.
Technical Details
Message-ID:
<445nn5$bg2@nntp.nta.no>Path:
arc1-ca.pugleaf.net!hal.nta.no!ohkReferences:
<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> <rgh.811775925@camo>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!hal.nta.no!ohk From: ohk@hal.nta.no (Ole-Hjalmar Kristensen TF.E/DELAB) Newsgroups: comp.lang.modula2,comp.lang.modula3,comp.lang.c,comp.lang.c++ Subject: Re: Modula-2, Modula-3, C or C++ Date: 25 Sep 1995 08:02:44 GMT Organization: Norwegian Telecom Research Distribution: world Message-ID: <445nn5$bg2@nntp.nta.no> 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> <rgh.811775925@camo> NNTP-Posting-Host: edeber.nta.no