https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121544
Bug ID: 121544
Summary: -fdump-ada-spec doesn't generate type definition for
pointer to structure as a structure element
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: ada
Assignee: unassigned at gcc dot gnu.org
Reporter: commaperiodsemicolon at gmail dot com
CC: dkm at gcc dot gnu.org
Target Milestone: ---
On gcc version 11.4.0, Linux x86_64,
When running -fdump-ada-spec on a C header file that contains a pointer to a
structure inside of a structure, the resultant Ada specification file does not
contain an element type for the structure pointer.
Here is a simple example:
# gcc -fdump-ada-spec libexample.h
libexample.h
============
struct Example {
int start;
struct {
int a, b, c;
} works;
struct {
int X, Y, Z;
} *doesnt_work;
};
This generates the following output (excerpt):
libexample_h.ads
================
type anon834_struct835 is record
end record
a : aliased int;
b : aliased int;
c : aliased int;
with Convention => C_Pass_By_Copy;
type Example is record
start : aliased int;
works : aliased anon834_struct835;
doesnt_work : access ; -- BUG: Missing type declaration here!
end record
with Convention => C_Pass_By_Copy;