From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: * X-Spam-Status: No, score=1.3 required=5.0 tests=BAYES_00,INVALID_MSGID, MSGID_RANDY autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,56250291936154a0 X-Google-Attributes: gid103376,public From: Robert Dewar Subject: Re: OS Bindings (was: Where is the elusive jump command?) Date: 2000/04/12 Message-ID: <8d0su8$bqt$1@nnrp1.deja.com>#1/1 X-Deja-AN: 609942799 References: <38D771CA.D41AF9B5@port.ac.uk> <8bq7ku$mc8$1@nnrp1.deja.com> <38E0E723.C39C392@quadruscorp.com> <8brfm4$4uc$1@nnrp1.deja.com> <8brn4k$p6i$1@slb0.atl.mindspring.net> <8brrpj$i04$1@nnrp1.deja.com> <38E312F8.78883ACB@icn.siemens.de> <8c4rvf$d9k$1@nnrp1.deja.com> <2000Apr5.070127.1@eisner> <2000Apr6.081305.1@eisner> <8ci6vf$r5a$1@nnrp1.deja.com> <8ck638$krs3@ftp.kvaerner.com> <8cp23c$4gp$1@nnrp1.deja.com> <8csjs8$o2p3@ftp.kvaerner.com> X-Http-Proxy: 1.0 x42.deja.com:80 (Squid/1.1.22) for client 205.232.38.14 Organization: Deja.com - Before you buy. X-Article-Creation-Date: Wed Apr 12 04:09:55 2000 GMT X-MyDeja-Info: XMYDJUIDrobert_dewar Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.61 [en] (OS/2; I) Date: 2000-04-12T00:00:00+00:00 List-Id: In article <8csjs8$o2p3@ftp.kvaerner.com>, "Tarjei T. Jensen" wrote: > In most cases where an unsigned type like size_t is used it is > apropriate to translate it to an unsigned integer of some sort > and not a modular type. Maybe so, C unlike Ada does not have this possibility, so it is indeed possible that the above is right. For example if we see in C unsigned char q; it maybe that the best Ada translation is type q is range 0 .. 255; for q'size use 8; but I still don't see the complaint, wrapping types like unsigned in C are useful in Ada and in C, and we have always have unsigned types in the sense of the above declaration of q in Ada. But I see the point you are making now. I still don't really see why you don't like the modular types, they seem useful and clear to me. After all Java decided it was all they needed :-) > Arithmetic operations which causes wraparound are most likely > errors and should be caught. OK, but this really has nothing to do with type checking, which is why I was confused by your original post. But if you want this kind of range checking, then of course do NOT use a modular type to model the C type. > Now I have to remember to check interface.C when I get home, > to check verify that the definition of int, short and long in > gnat has C semantics. Not sure what you mean here. In C, overflow for such types makes the program execution undefined, in Ada, the semantics is the same as C except in this undefined case, where Ada defines that CE must be raised. Sent via Deja.com http://www.deja.com/ Before you buy.