Blame SOURCES/0003-elf-fix-warning-message-caused-by-type-mismatch-of-o.patch

bd4871
From 8ff3de974aa9fdf8934797122dc55428ef571ab2 Mon Sep 17 00:00:00 2001
bd4871
From: Vincent Whitchurch <vincent.whitchurch@axis.com>
bd4871
Date: Tue, 21 Jun 2022 09:15:34 +0000
bd4871
Subject: [PATCH 3/5] elf: fix warning message caused by type mismatch of
bd4871
 offset types
bd4871
MIME-Version: 1.0
bd4871
Content-Type: text/plain; charset=UTF-8
bd4871
Content-Transfer-Encoding: 8bit
bd4871
bd4871
Use loff_t consistently to fix these warnings on -m32 builds on 64-bit:
bd4871
bd4871
 libgcore/gcore_coredump.c: In function ‘writenote’:
bd4871
 libgcore/gcore_coredump.c:701:58: warning: passing argument 3 of
bd4871
 ‘gcore->elf->ops->write_note_header’ from incompatible pointer type
bd4871
 [-Wincompatible-pointer-types]
bd4871
bd4871
   if (!gcore->elf->ops->write_note_header(gcore->elf, fp, foffset))
bd4871
                                                           ^~~~~~~
bd4871
 libgcore/gcore_coredump.c:701:58: note: expected ‘off_t *’ {aka ‘long
bd4871
 int *’} but argument is of type ‘loff_t *’ {aka ‘long long int *’}
bd4871
bd4871
Signed-off-by: Vincent Whitchurch <vincent.whitchurch@axis.com>
bd4871
Signed-off-by: Lianbo Jiang <lijiang@redhat.com>
bd4871
---
bd4871
 src/libgcore/gcore_defs.h       | 2 +-
bd4871
 src/libgcore/gcore_elf_struct.c | 4 ++--
bd4871
 2 files changed, 3 insertions(+), 3 deletions(-)
bd4871
bd4871
diff --git a/src/libgcore/gcore_defs.h b/src/libgcore/gcore_defs.h
bd4871
index 3233ea533ca0..409678e1ad68 100644
bd4871
--- a/src/libgcore/gcore_defs.h
bd4871
+++ b/src/libgcore/gcore_defs.h
bd4871
@@ -1232,7 +1232,7 @@ struct gcore_elf_operations
bd4871
 	int (*write_section_header)(struct gcore_elf_struct *this, FILE *fp);
bd4871
 	int (*write_program_header)(struct gcore_elf_struct *this, FILE *fp);
bd4871
 	int (*write_note_header)(struct gcore_elf_struct *this, FILE *fp,
bd4871
-				 off_t *offset);
bd4871
+				 loff_t *offset);
bd4871
 
bd4871
 	uint64_t (*get_e_phoff)(struct gcore_elf_struct *this);
bd4871
 	uint64_t (*get_e_shoff)(struct gcore_elf_struct *this);
bd4871
diff --git a/src/libgcore/gcore_elf_struct.c b/src/libgcore/gcore_elf_struct.c
bd4871
index 2aca984cf90f..b31388aa7e28 100644
bd4871
--- a/src/libgcore/gcore_elf_struct.c
bd4871
+++ b/src/libgcore/gcore_elf_struct.c
bd4871
@@ -141,7 +141,7 @@ static int elf64_write_program_header(struct gcore_elf_struct *this, FILE *fp)
bd4871
 }
bd4871
 
bd4871
 static int elf64_write_note_header(struct gcore_elf_struct *this, FILE *fp,
bd4871
-				   off_t *offset)
bd4871
+				   loff_t *offset)
bd4871
 {
bd4871
 	Elf64_Nhdr *n = &((struct gcore_elf64_struct *)this)->nhdr;
bd4871
 
bd4871
@@ -314,7 +314,7 @@ static int elf32_write_program_header(struct gcore_elf_struct *this, FILE *fp)
bd4871
 }
bd4871
 
bd4871
 static int elf32_write_note_header(struct gcore_elf_struct *this, FILE *fp,
bd4871
-				   off_t *offset)
bd4871
+				   loff_t *offset)
bd4871
 {
bd4871
 	Elf32_Nhdr *n = &((struct gcore_elf32_struct *)this)->nhdr;
bd4871
 
bd4871
-- 
bd4871
2.37.1
bd4871