public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
* [Bug libdw/29695] New: In libelf.h struct Elf, struct Elf_Scn is defined using typedef and not using #include <libelfP.h> is not the way to comply with the specification?
@ 2022-10-16 13:12 zhuorong.lin at outlook dot com
  2022-10-16 13:16 ` [Bug libelf/29695] " zhuorong.lin at outlook dot com
  2022-10-27 20:55 ` mark at klomp dot org
  0 siblings, 2 replies; 3+ messages in thread
From: zhuorong.lin at outlook dot com @ 2022-10-16 13:12 UTC (permalink / raw)
  To: elfutils-devel

https://sourceware.org/bugzilla/show_bug.cgi?id=29695

            Bug ID: 29695
           Summary: In libelf.h struct Elf, struct Elf_Scn is defined
                    using typedef and not using #include <libelfP.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: ---

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 <libelfP.h> 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);
```

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug libelf/29695] In libelf.h struct Elf, struct Elf_Scn is defined using typedef and not using #include <libelfP.h> is not the way to comply with the specification?
  2022-10-16 13:12 [Bug libdw/29695] New: In libelf.h struct Elf, struct Elf_Scn is defined using typedef and not using #include <libelfP.h> is not the way to comply with the specification? zhuorong.lin at outlook dot com
@ 2022-10-16 13:16 ` zhuorong.lin at outlook dot com
  2022-10-27 20:55 ` mark at klomp dot org
  1 sibling, 0 replies; 3+ messages in thread
From: zhuorong.lin at outlook dot com @ 2022-10-16 13:16 UTC (permalink / raw)
  To: elfutils-devel

https://sourceware.org/bugzilla/show_bug.cgi?id=29695

lin zhuorong <zhuorong.lin at outlook dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|libdw                       |libelf
                 CC|                            |zhuorong.lin at outlook dot com

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug libelf/29695] In libelf.h struct Elf, struct Elf_Scn is defined using typedef and not using #include <libelfP.h> is not the way to comply with the specification?
  2022-10-16 13:12 [Bug libdw/29695] New: In libelf.h struct Elf, struct Elf_Scn is defined using typedef and not using #include <libelfP.h> is not the way to comply with the specification? zhuorong.lin at outlook dot com
  2022-10-16 13:16 ` [Bug libelf/29695] " zhuorong.lin at outlook dot com
@ 2022-10-27 20:55 ` mark at klomp dot org
  1 sibling, 0 replies; 3+ messages in thread
From: mark at klomp dot org @ 2022-10-27 20:55 UTC (permalink / raw)
  To: elfutils-devel

https://sourceware.org/bugzilla/show_bug.cgi?id=29695

Mark Wielaard <mark at klomp dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
                 CC|                            |mark at klomp dot org
             Status|UNCONFIRMED                 |RESOLVED

--- Comment #1 from Mark Wielaard <mark at klomp dot org> ---
libelf.h is a public header. We explicitly don't want to declare complete types
for internal data structures. Which is why we don't include or expose
libelfP.h.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-10-27 20:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-16 13:12 [Bug libdw/29695] New: In libelf.h struct Elf, struct Elf_Scn is defined using typedef and not using #include <libelfP.h> is not the way to comply with the specification? zhuorong.lin at outlook dot com
2022-10-16 13:16 ` [Bug libelf/29695] " zhuorong.lin at outlook dot com
2022-10-27 20:55 ` mark at klomp dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).