ADA - pre and post conditions not working?

460 Views Asked by At

I am trying to learn on my own pre and post conditions in ada.

1

There are 1 best solutions below

0
On BEST ANSWER

If using GNAT (which looks like it's the default for jdoodle), you need to enable assertions. Add -gnata as a command line parameter.

EDIT: I don't know much about jdoodle, but it seems it can't take arguments to the compiler, only when running your program...

Instead, you could add a pragma Assertion_Policy to your program, like this:

procedure Tp2q4 is
   pragma Assertion_Policy(Check);

   --...