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 Wright Newsgroups: comp.lang.ada Subject: Re: Build language with weak typing, then add scaffolding later to strengthen it? Date: Fri, 22 May 2015 18:57:22 +0100 Organization: A noiseless patient Spider Message-ID: References: <127b004d-2163-477b-9209-49d30d2da5e1@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx02.eternal-september.org; posting-host="8f3bdf433f184ad9fec01bd73e350c65"; logging-data="13912"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+VZCUED8n4GVXJ2Z385kBFSJC0zC2DYrk=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (darwin) Cancel-Lock: sha1:xYntpoindMPaw4BpHl4h+EnR+54= sha1:+YCK2ORce1nKeqHR5CvABcX53Xs= Xref: news.eternal-september.org comp.lang.ada:25957 Date: 2015-05-22T18:57:22+01:00 List-Id: Simon Clubley writes: > 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. When I was translating STM32F4 headers into Ada, I was able to convert the -fdump-ada-spec generated uint32_t into Interfaces.Unsigned_32, which seemed to work very well (though exceedingly thin, of course!) Bit of sed script: # Unsigned types in parameters/record components s/stdint_h.uint(8|16|32|64)_t/Interfaces.Unsigned_\1/g