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

Ada's Image_Should_Call_Put_Image Renamed to Image_Must_Call_Put_Image.

The Ada runtime function Image_Should_Call_Put_Image was renamed to Image_Must_Call_Put_Image due to its semantics.

The function Image_Should_Call_Put_Image in the Ada runtime library has been renamed to Image_Must_Call_Put_Image. This change reflects the function’s actual behavior, as there is no flexibility in whether it needs to be called. The renaming affects several files that reference the function, including exp_put_image.ads, exp_put_image.adb, exp_imgv.adb, and sem_attr.adb.

In Details

The Ada runtime library includes the exp_put_image component, which handles the 'Image attribute for enumeration types. The Image_Should_Call_Put_Image function determines whether the Put_Image procedure must be called during the expansion of the 'Image attribute for enumeration types. The change simplifies the code and aligns the naming convention with the actual behavior of the function.

For Context

In Ada, the 'Image attribute converts a value to its string representation. The exp_put_image component handles this conversion for user-defined enumeration types, which are similar to enums in C or Java. The code determines whether a specific procedure, Put_Image, needs to be called during this conversion. This commit renames a function to better reflect its purpose, improving code clarity.

Filed Under: adarefactoringnaming