You can’t. The Selector_Type is volatile because it’s an interface to the operating system, and may (will) change without any action on the part of the Ada code.
My trial example was
package Rules is
type Selector is limited private;
private
type Selector is null record with Volatile;
S : Selector;
end Rules;
checked as
$ gnatcheck --show-rule rules.ads -rules +RVolatile_Objects_Without_Address_Clauses
rules.ads:5:04: volatile object with no address clause [Volatile_Objects_Without_Address_Clauses]
It seems that you have to say what rules you want checked, why not just don’t select this one?
Alternatively, if you have control of the source, you can apply an exemption.
In this case, this would look like
package Rules is
type Selector is limited private;
private
type Selector is null record with Volatile;
pragma Annotate (Gnatcheck, Exempt_On,
"Volatile_Objects_Without_Address_Clauses",
"only a demo!");
S : Selector;
pragma Annotate (Gnatcheck, Exempt_Off,
"Volatile_Objects_Without_Address_Clauses");
T : Selector;
end Rules;
and now it checks as
$ gnatcheck --show-rule rules.ads -rules +RVolatile_Objects_Without_Address_Clauses
rules.ads:11:04: volatile object with no address clause [Volatile_Objects_Without_Address_Clauses]
(line 11 is T's unexempted declaration; no complaint about S's declaration on line 8).
Note:
Apologies for earlier versions of this answer, which had a fundamental misunderstanding. gnatcheck supports the rule just fine, so long as you read it properly: it’s about volatile objects with no address clause, not volatile types.