Two runtime asserts in gelf_getnote() compare sizeof GElf_Nhdr with
Elf32_Ndhr and Elf64_Nhdr.  This can be done at compile time using
eu_static_assert.

Signed-off-by: Aaron Merey <[email protected]>
---
 libelf/gelf_getnote.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libelf/gelf_getnote.c b/libelf/gelf_getnote.c
index 0f7b9d68..2cf28565 100644
--- a/libelf/gelf_getnote.c
+++ b/libelf/gelf_getnote.c
@@ -51,8 +51,8 @@ gelf_getnote (Elf_Data *data, size_t offset, GElf_Nhdr 
*result,
 
   /* It's easy to handle this type.  It has the same size for 32 and
      64 bit objects.  */
-  assert (sizeof (GElf_Nhdr) == sizeof (Elf32_Nhdr));
-  assert (sizeof (GElf_Nhdr) == sizeof (Elf64_Nhdr));
+  eu_static_assert (sizeof (GElf_Nhdr) == sizeof (Elf32_Nhdr));
+  eu_static_assert (sizeof (GElf_Nhdr) == sizeof (Elf64_Nhdr));
 
   rwlock_rdlock (((Elf_Data_Scn *) data)->s->elf->lock);
 
-- 
2.51.0

Reply via email to