From mboxrd@z Thu Jan 1 00:00:00 1970 Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Kevin Chadwick Newsgroups: comp.lang.ada Subject: GNAT.Source_Info Volatile and SPARK Date: Fri, 8 Dec 2023 18:28:24 -0000 (UTC) Organization: A noiseless patient Spider Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Fri, 8 Dec 2023 18:28:24 -0000 (UTC) Injection-Info: dont-email.me; posting-host="416a53f25687c8ca32bfa777936870fc"; logging-data="1943066"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+/Tc1wvDUROKaS0zgRopfR3c/5D+7n8A8=" User-Agent: PhoNews/3.13.2 (Android/13) Cancel-Lock: sha1:zfNJ+rYkI7eT0JdmHOsEcR6uu60= Xref: news.eternal-september.org comp.lang.ada:65894 List-Id: I guess the SPARK annotations in GNAT.Source_Info mark them as Volatile_Functions for good reason. I'm not sure how to handle using them in SPARK. They produce compile time known constants but I guess SPARK does not know e.g. the String length. I use them in a logging function which is everywhere. So I get error Volatile function call as actual is not allowed in SPARK when calling GNAT.Source_Info.Source_Location as a loggers parameter. Perhaps I should just avoid using them for SPARK compatibility? I can get by with GNAT.Source_Info.Line which only produces warnings and not the above error but it is not ideal. I can use the function File as a package global constant. Any other ideas? -- Regards, Kc