简体   繁体   中英

ADA - pre and post conditions not working?

我正在尝试根据自己的 ada 前后条件进行学习。

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);

   --...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM