GCC Newspaper
JUNE 15, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
ada

Ada: Add missing assertion level check in SPARK mode.

The Ada compiler adds a missing check for assertion levels inside aspect specifications in SPARK mode.

The Ada compiler adds a missing check for assertion levels inside aspect specifications, as described in rule 14 of SPARK RM 6.9. This enforces assertion levels within aspect specifications, ensuring compliance with the SPARK subset of Ada.

In Details

This commit modifies ghost.adb to add a check for assertion levels inside aspect specifications, enforcing rule 14 of SPARK RM 6.9. SPARK provides a subset of Ada intended for high-assurance software development; code written in SPARK can be statically verified to be free of certain runtime errors. The change ensures adherence to SPARK's rules regarding assertion levels within aspect specifications.

For Context

SPARK is a subset of the Ada language designed for writing high-integrity software. It allows for formal verification of code, ensuring the absence of certain types of errors. Aspect specifications are used to provide additional information about program entities, such as pre- and post-conditions. Assertion levels control the degree to which these conditions are checked. This commit adds a check to ensure that the level of checking is correctly applied within aspect specifications when using SPARK.

Filed Under: adaSPARKassertion