https://sourceware.org/bugzilla/show_bug.cgi?id=29711
Bug ID: 29711 Summary: In libdw.h struct Dwarf, struct Dwarf_Abbrev is defined using typedef and not using #include <libdwP.h> is not the way to comply with the specification? Product: elfutils Version: unspecified Status: UNCONFIRMED Severity: normal Priority: P2 Component: libdw Assignee: unassigned at sourceware dot org Reporter: zhuorong.lin at outlook dot com CC: elfutils-devel at sourceware dot org Target Milestone: --- Is directly typedef an undefined struct not in compliance with the specification. libdw.h ``` typedef struct Dwarf_Abbrev Dwarf_Abbrev; /* Returned to show the last DIE has be returned. */ #define DWARF_END_ABBREV ((Dwarf_Abbrev *) -1l) /* Source code line information for CU. */ typedef struct Dwarf_Lines_s Dwarf_Lines; /* One source code line information. */ typedef struct Dwarf_Line_s Dwarf_Line; /* Source file information. */ typedef struct Dwarf_Files_s Dwarf_Files; /* One address range record. */ typedef struct Dwarf_Arange_s Dwarf_Arange; /* Address ranges of a file. */ typedef struct Dwarf_Aranges_s Dwarf_Aranges; ``` libdwP.h ``` /* Abbreviation representation. */ struct Dwarf_Abbrev { Dwarf_Off offset; /* Offset to start of abbrev into .debug_abbrev. */ unsigned char *attrp; /* Pointer to start of attribute name/form pairs. */ bool has_children : 1; /* Whether or not the DIE has children. */ unsigned int code : 31; /* The (unique) abbrev code. */ unsigned int tag; /* The tag of the DIE. */ } attribute_packed; #include "dwarf_abbrev_hash.h" /* Files in line information records. */ struct Dwarf_Files_s { unsigned int ndirs; unsigned int nfiles; struct Dwarf_Fileinfo_s { char *name; Dwarf_Word mtime; Dwarf_Word length; } info[0]; /* nfiles of those, followed by char *[ndirs]. */ }; typedef struct Dwarf_Fileinfo_s Dwarf_Fileinfo; /* Representation of a row in the line table. */ struct Dwarf_Line_s { Dwarf_Files *files; Dwarf_Addr addr; unsigned int file; int line; unsigned short int column; unsigned int is_stmt:1; unsigned int basic_block:1; unsigned int end_sequence:1; unsigned int prologue_end:1; unsigned int epilogue_begin:1; /* The remaining bit fields are not flags, but hold values presumed to be small. All the flags and other bit fields should add up to 48 bits to give the whole struct a nice round size. */ unsigned int op_index:8; unsigned int isa:8; unsigned int discriminator:24; }; struct Dwarf_Lines_s { size_t nlines; struct Dwarf_Line_s info[0]; }; ``` -- You are receiving this mail because: You are on the CC list for the bug.