From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 860613858D37; Fri, 21 Oct 2022 01:30:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 860613858D37 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666315837; bh=sYsPloO99CBEqdsQMzM66h4HMeNqV9bkXULz7rYf5Io=; h=From:To:Subject:Date:From; b=Nwkc4WvuISrK7vBhyQqj4FJXrxCfIE9oDbfoeLnh7WS0gZ4/Qg6C/H+fwjM24RytF 83e1pPhZcrZrufiNpHYjlnaMpHOJSDvwAIiBI3+oBxz8/02fPtQwWdlDvTFU3zqRyY vtB5RgQPZ+/4A9YX5/Pt2JdlBSlV6mMgV7i6jpvs= From: "zhuorong.lin at outlook dot com" To: elfutils-devel@sourceware.org Subject: [Bug libdw/29711] New: In libdw.h struct Dwarf, struct Dwarf_Abbrev is defined using typedef and not using #include is not the way to comply with the specification? Date: Fri, 21 Oct 2022 01:30:34 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: elfutils X-Bugzilla-Component: libdw X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: zhuorong.lin at outlook dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter cc target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D29711 Bug ID: 29711 Summary: In libdw.h struct Dwarf, struct Dwarf_Abbrev is defined using typedef and not using #include 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]; }; ``` --=20 You are receiving this mail because: You are on the CC list for the bug.=