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

Add Function to Check for Suppressed Loop Warnings

Adds In_Loop_With_Suppressed_Warnings to check if warnings are suppressed within loops, improving Ada compiler diagnostics.

This commit adds a new function, In_Loop_With_Suppressed_Warnings, to the Ada compiler. This function checks whether warnings are suppressed within loops. This enhancement provides more information when reporting errors, especially within loop constructs where warnings might be intentionally suppressed, clarifying the diagnostic messages for the user.

In Details

The errout package in GNAT handles error reporting. This commit adds In_Loop_With_Suppressed_Warnings to errout.adb. This improves the context provided when generating error messages. Toolchain developers outside the Ada front-end may see this as a refinement of the diagnostic reporting.

For Context

This commit enhances the Ada compiler's ability to provide more informative warnings. Specifically, it adds a check to see if warnings related to loops (sections of code that repeat) have been intentionally suppressed by the programmer. By knowing this, the compiler can provide more context-aware and helpful messages, potentially saving the programmer time when debugging their code.

Filed Under: adawarningsloopsdiagnostics