-gnatRh flag failing

Hello - I am trying to apply one of the -gnatR flags (specifically -gnatR3h) in my gpr file but that seems to be failing compilation. As the gnat ug mentions:

If the switch is followed by a h (e.g. -gnatR3h), then the components of records
are sorted by increasing offsets and holes between consecutive components are
flagged.

and that’s what I’m trying to see but it doesn’t seem to work. When I specify that I am getting:

gnat1: invalid switch: -gnatRh

and compilation fails. The 3 specifier is missing from the error message (not sure if that’s actually relevant) but I get the same error for any other level too so the culprit seems to be the h specifier.

Any ideas what might be wrong? Is that a known issue?

Using alr 2.1.0 and gnat_native = "=15.2.1"

Thanks

From the up-to-date UG:

-gnatR[0|1|2|3|4][e][h][m][j][s]
Output representation information for declared types, objects and subprograms. Note that this switch is not allowed if a previous -gnatD switch has been given, since these two switches are not compatible.

Are you using -gnatD also? I suppose no, but it could help to check.

Best regards,
Fer

EDIT:

The full documentation is found in section 4.3.16 of the UG in GCC 16 and it says

-gnatR[0|1|2|3|4][e][h][m][j][s]

This switch controls output from the compiler of a listing showing representation information for declared types, objects and subprograms. For -gnatR0, no information is output (equivalent to omitting the -gnatR switch). For -gnatR1 (which is the default, so -gnatR with no parameter has the same effect), size and alignment information is listed for declared array and record types.

For -gnatR2, size and alignment information is listed for all declared types and objects. The Linker_Section is also listed for any entity for which the Linker_Section is set explicitly or implicitly (the latter case occurs for objects of a type for which a Linker_Section is set).

For -gnatR3, symbolic expressions for values that are computed at run time for records are included. These symbolic expressions have a mostly obvious format with #n being used to represent the value of the n’th discriminant. See source files repinfo.ads/adb in the GNAT sources for full details on the format of -gnatR3 output.

For -gnatR4, information for relevant compiler-generated types is also listed, i.e. when they are structurally part of other declared types and objects.

If the switch is followed by an e (e.g. -gnatR2e), then extended representation information for record sub-components of records is included.

If the switch is followed by a h (e.g. -gnatR3h), then the components of records are sorted by increasing offsets and holes between consecutive components are flagged.

If the switch is followed by an m (e.g. -gnatRm), then subprogram conventions and parameter passing mechanisms for all the subprograms are included.

If the switch is followed by a j (e.g. -gnatRj), then the output is in the JSON data interchange format specified by the ECMA-404 standard. The semantic description of this JSON output is available in the specification of the Repinfo unit present in the compiler sources.

If the switch is followed by an s (e.g. -gnatR3s), then the output is to a file with the name file.rep where file is the name of the corresponding source file, except if j is also specified, in which case the file name is file.json.

Note that it is possible for record components to have zero size. In this case, the component clause uses an obvious extension of permitted Ada syntax, for example at 0 range 0 .. -1.

So I stand corrected about my comment on documentation

1 Like