[sysprof] elfparser: suppress warnings about cast alignment
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [sysprof] elfparser: suppress warnings about cast alignment
- Date: Mon, 22 Aug 2016 00:34:06 +0000 (UTC)
commit 46a257da6e5c3790e42f586913ba51a7b534cb8b
Author: Christian Hergert <chergert redhat com>
Date: Sun Aug 21 17:32:44 2016 -0700
elfparser: suppress warnings about cast alignment
These are aligned according to the spec, so we can simply silence them
with the gpointer cast.
lib/util/elfparser.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/lib/util/elfparser.c b/lib/util/elfparser.c
index 2d4cb52..881bcc2 100644
--- a/lib/util/elfparser.c
+++ b/lib/util/elfparser.c
@@ -71,11 +71,11 @@ struct ElfParser
*/
#define GET_FIELD(parser, offset, struct_name, idx, field_name) \
(((parser))->is_64? \
- ((Elf64_ ## struct_name *)(((parser)->data + offset)) + (idx))->field_name : \
- ((Elf32_ ## struct_name *)(((parser)->data + offset)) + (idx))->field_name)
+ ((Elf64_ ## struct_name *)(gpointer)(((parser)->data + offset)) + (idx))->field_name : \
+ ((Elf32_ ## struct_name *)(gpointer)(((parser)->data + offset)) + (idx))->field_name)
#define GET_UINT32(parser, offset) \
- *((uint32_t *)(parser->data + offset)) \
+ *((uint32_t *)(gpointer)(parser->data + offset)) \
#define GET_SIZE(parser, struct_name) \
(((parser)->is_64? \
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]