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.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Simon Clubley Newsgroups: comp.lang.ada Subject: Re: Build language with weak typing, then add scaffolding later to strengthen it? Date: Fri, 22 May 2015 17:39:41 +0000 (UTC) Organization: A noiseless patient Spider Message-ID: References: <127b004d-2163-477b-9209-49d30d2da5e1@googlegroups.com> Injection-Date: Fri, 22 May 2015 17:39:41 +0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="e8e016ba08adbcea049ce8081eb0079d"; logging-data="11475"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19yoEcP+V7i+Q49ul/sObFPtRJedXU/6Po=" User-Agent: slrn/0.9.8.1 (VMS/Multinet) Cancel-Lock: sha1:sCU/ZePNdrJp+OSdeuB3exOrn6E= Xref: news.eternal-september.org comp.lang.ada:25954 Date: 2015-05-22T17:39:41+00:00 List-Id: On 2015-05-22, kalvin.news@gmail.com wrote: > > My point here is that although an int is an int, an int in one context may be totally different from another int, although both entities are of type int. > > For example, a low-level harddisk device driver might contain declarations like this: > > int cylinder = 1; > int head = 2; > int sector = 3; > What I would hope is that the designer uses unsigned integers for those variables and, in order to make the code portable across platforms, they used uint32_t and friends to encode within the program what the actual required size of those variables need to be. Simon. PS: This is _not_ a dig at you BTW but an observation on some C code that I have looked at. I don't like seeing see code use plain integers when an unsigned integer better models the problem at hand. -- Simon Clubley, clubley@remove_me.eisner.decus.org-Earth.UFP Microsoft: Bringing you 1980s technology to a 21st century world