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

Refine conformance warning logic in Ada

This commit simplifies Ada's conformance warning logic by removing redundant checks.

This commit refines the logic for issuing conformance warnings in the Ada compiler. It removes redundant checks for -gnatg mode and internal units when determining whether to enable a stricter conformance warning (-gnatw_p). The -gnatg switch already disables -gnatw_p, making the explicit check unnecessary. This simplification streamlines the code and reduces potential confusion.

In Details

The commit modifies Subprogram_Subtypes_Have_Same_Declaration in sem_ch6.adb by removing redundant checks for In_Internal_Unit and GNAT_Mode. The -gnatg switch implicitly disables -gnatw_p, making the explicit check redundant. This change clarifies the warning logic within the Ada semantic analysis phase.

For Context

This commit deals with the Ada compiler's conformance checking process. Conformance checking ensures that Ada code adheres to the language standard. The compiler can issue warnings when it detects code that deviates from the standard, or that uses features in a non-standard way. This commit simplifies the logic that controls when these warnings are issued, making the code cleaner and easier to understand.

Filed Under: adawarningsconformance