Next: Multiple_Entries_In_Protected_Definitions, Previous: Misnamed_Controlling_Parameters, Up: Predefined Rules
Misnamed_Identifiers
Flag the declaration of each identifier that does not have a suffix corresponding to the kind of entity being declared. The following declarations are checked:
This rule may have parameters. When used without parameters, the rule enforces the following checks:
_T
, unless the type is an access type,
in which case the suffix must be _A
_C
_R
Defining identifiers from incomplete type declarations are never flagged.
For a private type declaration (including private extensions), the defining identifier from the private type declaration is checked against the type suffix (even if the corresponding full declaration is an access type declaration), and the defining identifier from the corresponding full type declaration is not checked.
For a deferred constant, the defining name in the corresponding full constant declaration is not checked.
Defining names of formal types are not checked.
The rule may have the following parameters:
Default
Type_Suffix=
stringAccess_Suffix=
stringType_Suffix
parameter.
For access types, string may have the following format:
suffix1(suffix2). That means that an access type name
should have the suffix1 suffix except for the case when
the designated type is also an access type, in this case the
type name should have the suffix1 & suffix2 suffix.
Class_Access_Suffix=
stringType_Suffix
or Access_Suffix
parameter.
Class_Subtype_Suffix=
stringConstant_Suffix=
stringRenaming_Suffix=
stringAll_Suffixes
Type_Suffix
Access_Suffix
is
set).
Access_Suffix
Type_Suffix
is set, access type names are
checked as ordinary type names.
Class_Access_Suffix
Type_Suffix
is set, access type names are
checked as ordinary type names. If Access_Suffix
is set, these
access types are checked as any other access type name.
Class_Subtype_Suffix=
stringConstant_Suffix
Renaming_Suffix
If more than one parameter is used, parameters must be separated by commas.
If more than one option is specified for the gnatcheck invocation, a new option overrides the previous one(s).
The +RMisnamed_Identifiers option (with no parameter) enables checks for all the name suffixes specified by previous options used for this rule.
The -RMisnamed_Identifiers option (with no parameter) disables all the checks but keeps all the suffixes specified by previous options used for this rule.
The string value must be a valid suffix for an Ada identifier (after trimming all the leading and trailing space characters, if any). Parameters are not case sensitive, except the string part.
If any error is detected in a rule parameter, the parameter is ignored. In such a case the options that are set for the rule are not specified.