help / color / mirror / Atom feed
From: Kevin Chadwick <>
Subject: GNAT.Source_Info Volatile and SPARK
Date: Fri, 8 Dec 2023 18:28:24 -0000 (UTC)	[thread overview]
Message-ID: <ukvn87$1r9gq$> (raw)

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

             reply	other threads:[~2023-12-08 18:28 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-08 18:28 Kevin Chadwick [this message]
2023-12-09 14:16 ` GNAT.Source_Info Volatile and SPARK Kevin Chadwick
2023-12-09 14:33   ` Kevin Chadwick
2023-12-09 14:57     ` Jeffrey R.Carter
2023-12-09 15:13       ` Kevin Chadwick
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox