libx86: Fix pointer typecasting in assignment

Signed-off-by: Khem Raj <raj.khem@gmail.com>
This commit is contained in:
Khem Raj 2022-09-02 00:30:24 -07:00
parent 12e249a556
commit 5dec03ef88
2 changed files with 34 additions and 0 deletions

View File

@ -0,0 +1,33 @@
From c782e208021409e9b78acb2200abd4319072e78a Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Fri, 2 Sep 2022 00:28:05 -0700
Subject: [PATCH] Fix type of the void pointer assignment
Fixes build with clang
x86-common.c:216:9: error: incompatible integer to pointer conversion assigning to 'void *' from 'long' [-Wint-conversion]
offset = mem_info.offset - REAL_MEM_BASE;
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
x86-common.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/x86-common.c b/x86-common.c
index 137bc3c..6f737ed 100644
--- a/x86-common.c
+++ b/x86-common.c
@@ -213,7 +213,7 @@ void *LRMI_common_init(int high_page)
if (!real_mem_init(high_page))
return NULL;
- offset = mem_info.offset - REAL_MEM_BASE;
+ offset = (void*)(mem_info.offset - REAL_MEM_BASE);
/*
Map the Interrupt Vectors (0x0 - 0x400) + BIOS data (0x400 - 0x502)
--
2.37.3

View File

@ -11,6 +11,7 @@ SRC_URI = "http://www.codon.org.uk/~mjg59/libx86/downloads/${BPN}-${PV}.tar.gz \
file://libx86-mmap-offset.patch \
file://0001-assume-zero-is-valid-address.patch \
file://makefile-add-ldflags.patch \
file://0001-Fix-type-of-the-void-pointer-assignment.patch \
"
SRC_URI[md5sum] = "41bee1f8e22b82d82b5f7d7ba51abc2a"