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

Ada accessibility check function renamed for clarity

A function that checks accessibility in Ada has been renamed to better reflect its broader use beyond just parameters, improving code readability.

The function Apply_Accessibility_Check_For_Parameter in the Ada front end has been renamed to Apply_Accessibility_Check_For_Conversion. This renaming reflects that the function is also used for Ada 2012’s stand-alone objects of anonymous access types, not solely for access parameters. The change improves the accuracy and clarity of the codebase by giving the function a name that encompasses all its use cases.

In Details

This commit specifically renames the Apply_Accessibility_Check_For_Parameter routine in accessibility.ads and accessibility.adb to Apply_Accessibility_Check_For_Conversion within the GCC Ada front end. This is a targeted refactoring to more accurately describe the function's role. Beyond just access parameters, this routine is also invoked for Ada 2012's stand-alone objects of anonymous access types during implicit or explicit conversions. The renaming improves code clarity and maintains consistency with the Ada Language Reference Manual (ALRM) by precisely reflecting the contexts in…

For Context

In programming languages like Ada, 'accessibility' refers to rules that govern how different parts of a program can interact with memory and data, especially when dealing with pointers or 'access types'. This is crucial for preventing errors like using memory that has already been freed. This change in the GCC Ada compiler involves renaming a function. The old name, Apply_Accessibility_Check_For_Parameter, suggested it was only used when checking function parameters. However, the function is also used in other situations, specifically when converting certain types of anonymous access objects introduced in Ada 2012. Renaming it to Apply_Accessibility_Check_For_Conversion makes the code more understandable and accurately describes all its responsibilities in enforcing Ada's accessibility rules.

Filed Under: adarefactoringreadability