Last active
August 29, 2015 13:58
-
-
Save rtyler/10197343 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[14:42:43] tyler:fosdem-ada $ ./precondition | |
burp | |
PING! | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
with Ada.Text_IO; | |
package body Fosdem is | |
function Is_Valid return Boolean is | |
begin | |
return False; | |
end Is_Valid; | |
procedure Ping is | |
begin | |
Ada.Text_IO.Put_Line ("PING!"); | |
end Ping; | |
end Fosdem; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package Fosdem is | |
function Is_Valid return Boolean; | |
procedure Ping | |
with Pre => (Is_Valid = True); | |
end Fosdem; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
project Fosdem is | |
for Source_Dirs use ("."); | |
for Object_Dir use "obj"; | |
for Main use ("precondition.adb"); | |
package Compiler is | |
for Switches ("Ada") use ("-g", "-gnata", "-gnat2012"); | |
end Compiler; | |
end Fosdem; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
with Ada.Text_IO; | |
with Fosdem; | |
procedure Precondition is | |
use Ada.Text_IO; | |
begin | |
Put_Line ("burp"); | |
Fosdem.Ping; | |
Put_Line("done"); | |
end Precondition; | |
With GNATMAKE GPL 2013 (20130314) your example works as expected.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You should include the "-fstack-check" and "-gnato" flags for the compiler to get proper Ada behaviour out of GNAT.