comp.lang.ada
 help / color / mirror / Atom feed
* GNAT.Source_Info Volatile and SPARK
@ 2023-12-08 18:28 Kevin Chadwick
  2023-12-09 14:16 ` Kevin Chadwick
  0 siblings, 1 reply; 5+ messages in thread
From: Kevin Chadwick @ 2023-12-08 18:28 UTC (permalink / 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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-12-09 15:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-08 18:28 GNAT.Source_Info Volatile and SPARK Kevin Chadwick
2023-12-09 14:16 ` Kevin Chadwick
2023-12-09 14:33   ` Kevin Chadwick
2023-12-09 14:57     ` Jeffrey R.Carter
2023-12-09 15:13       ` Kevin Chadwick

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