Pragma Rename_Pragma (GNAT Reference Manual) (original) (raw)
2.156 Pragma Rename_Pragma ¶
Syntax:
pragma Rename_Pragma ( [New_Name =>] IDENTIFIER, [Renamed =>] pragma_IDENTIFIER);
This pragma provides a mechanism for supplying new names for existing pragmas. The New_Name
identifier can subsequently be used as a synonym for the Renamed pragma. For example, suppose you have code that was originally developed on a compiler that supports Inline_Only as an implementation defined pragma. And suppose the semantics of pragma Inline_Only are identical to (or at least very similar to) the GNAT implementation defined pragma Inline_Always. You could globally replace Inline_Only with Inline_Always.
However, to avoid that source modification, you could instead add a configuration pragma:
pragma Rename_Pragma ( New_Name => Inline_Only, Renamed => Inline_Always);
Then GNAT will treat “pragma Inline_Only …” as if you had written “pragma Inline_Always …”.
Pragma Inline_Only will not necessarily mean the same thing as the other Ada compiler; it’s up to you to make sure the semantics are close enough.