From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on ip-172-31-65-14.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: GNAT Community 2020 (20200818-93): Big_Integer Date: Sat, 01 Jul 2023 13:12:13 +0100 Organization: A noiseless patient Spider Message-ID: References: <55561d4b-8288-4770-a7b5-681567752ab0n@googlegroups.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: dont-email.me; posting-host="62632d92463326eb3c9a5ec09a14c534"; logging-data="3078837"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19hzPDrI1z3IJatS52tzfuzj4f5NoFbkh8=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (darwin) Cancel-Lock: sha1:XcRzMahGP20uATGNBnIE4SHwzdU= sha1:eXVUtzhd4D7STylEyEU60aXYcF4= Xref: news.eternal-september.org comp.lang.ada:65391 List-Id: Frank Jørgen Jørgensen writes: > I'm running the below program with GNAT Community 2020 (20200818-93) > on Windows 11 Home. > I have some problems trying to save big numbers to a file - so I > noticed this behaviour: > If I open Test.dat in Visual Studio Hex editor, it seems like this > program saves this big number with a different bit pattern each time. > Is that as expected? > I do have some problems reading back the big numbers in my real code. Looking at the source for Big_Integer[1] I see no trace of streaming support; what you got streamed was the address of some allocated data used under the hood to contain the big integer. I don't know whether the ARM requires/expects Big_Integer to be streamable, but I think you had every reason to expect it! [1] https://github.com/gcc-mirror/gcc/blob/7e904d6c7f252ee947c237ed32dd43b2c248384d/gcc/ada/libgnat/a-nbnbin.ads#L171