From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id BD1FE3857BB8; Sun, 16 Oct 2022 13:12:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BD1FE3857BB8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1665925951; bh=FvJzA5UOXBKq6plNGhjztZJL5RrNx9CDBxUuc0iNh+E=; h=From:To:Subject:Date:From; b=NMRmotJzgExWQMgt8yD0dAntseEYdgjoli1Wquj0hbqwX5THuJARJPjIyE5IKDQPZ IcBQw8GYMrgLN+5gAoRdyUlnDTGbfBpCWeTal76LizCRImCJB713ZF8XYb21Q2Mgj/ a7I2K5dohYkLs+TEl9hKz01i7txPKmblvmPOnLA4= From: "zhuorong.lin at outlook dot com" To: elfutils-devel@sourceware.org Subject: [Bug libdw/29695] New: In libelf.h struct Elf, struct Elf_Scn is defined using typedef and not using #include is not the way to comply with the specification? Date: Sun, 16 Oct 2022 13:12:31 +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=3D29695 Bug ID: 29695 Summary: In libelf.h struct Elf, struct Elf_Scn 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: --- In the source code, libelf.h in the libelf directory is just typedef struct Elf, struct ElfScn, and the real definition is in libelfP.h, and there is no #include in libelf.h. Is directly typedef an undefined struct not in compliance with the specification. libelf.h ``` /* Archive symbol table entry. */ typedef struct { char *as_name; /* Symbol name. */ size_t as_off; /* Offset for this file in the archive. */ unsigned long int as_hash; /* Hash value of the name. */ } Elf_Arsym; /* Descriptor for the ELF file. */ typedef struct Elf Elf; /* Descriptor for ELF file section. */ typedef struct Elf_Scn Elf_Scn; #ifdef __cplusplus extern "C" { #endif /* Return descriptor for ELF file to work according to CMD. */ extern Elf *elf_begin (int __fildes, Elf_Cmd __cmd, Elf *__ref); /* Create a clone of an existing ELF descriptor. */ extern Elf *elf_clone (Elf *__elf, Elf_Cmd __cmd); /* Create descriptor for memory region. */ extern Elf *elf_memory (char *__image, size_t __size); /* Advance archive descriptor to next element. */ extern Elf_Cmd elf_next (Elf *__elf); ``` --=20 You are receiving this mail because: You are on the CC list for the bug.=