diff mbox series

[11] libiberty, Darwin: Fix a build warning. [PR112823]

Message ID 20231202053024.1689677-1-sam@gentoo.org
State New
Headers show
Series [11] libiberty, Darwin: Fix a build warning. [PR112823] | expand

Commit Message

Sam James Dec. 2, 2023, 5:30 a.m. UTC
From: Iain Sandoe <iain@sandoe.co.uk>

r12-3005-g220c410162ebece4f missed a cast for the set_32 call.
Fixed thus.

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
Signed-off-by: Sam James <sam@gentoo.org>

libiberty/ChangeLog:
	PR other/112823
	* simple-object-mach-o.c (simple_object_mach_o_write_segment):
	Cast the first argument to set_32 as needed.

(cherry picked from commit 38757aa88735ab2e511bc428e2407a5a5e9fa0be)
---
 libiberty/simple-object-mach-o.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Iain Sandoe Dec. 2, 2023, 7:20 a.m. UTC | #1
HI Sam,

I think this qualifies as obvious (it’s on my list, but I did not get to it yet,
so go ahead).

Iain

> On 2 Dec 2023, at 05:30, Sam James <sam@gentoo.org> wrote:
> 
> From: Iain Sandoe <iain@sandoe.co.uk>
> 
> r12-3005-g220c410162ebece4f missed a cast for the set_32 call.
> Fixed thus.
> 
> Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
> Signed-off-by: Sam James <sam@gentoo.org>
> 
> libiberty/ChangeLog:
> 	PR other/112823
> 	* simple-object-mach-o.c (simple_object_mach_o_write_segment):
> 	Cast the first argument to set_32 as needed.
> 
> (cherry picked from commit 38757aa88735ab2e511bc428e2407a5a5e9fa0be)
> ---
> libiberty/simple-object-mach-o.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libiberty/simple-object-mach-o.c b/libiberty/simple-object-mach-o.c
> index 72b69d19c216..a8869e7c6395 100644
> --- a/libiberty/simple-object-mach-o.c
> +++ b/libiberty/simple-object-mach-o.c
> @@ -1228,7 +1228,7 @@ simple_object_mach_o_write_segment (simple_object_write *sobj, int descriptor,
>       /* Swap the indices, if required.  */
> 
>       for (i = 0; i < (nsects_in * 4); ++i)
> -	set_32 (&index[i], index[i]);
> +	set_32 ((unsigned char *) &index[i], index[i]);
> 
>       sechdr_offset += sechdrsize;
> 
> -- 
> 2.43.0
>
Sam James Dec. 2, 2023, 7:31 a.m. UTC | #2
Iain Sandoe <iain@sandoe.co.uk> writes:

> HI Sam,

Hi Iain,

>
> I think this qualifies as obvious (it’s on my list, but I did not get to it yet,
> so go ahead).

Thanks. I can't push it myself - could you do that for me?

thanks again,
sam

>
> Iain
>
>> On 2 Dec 2023, at 05:30, Sam James <sam@gentoo.org> wrote:
>> 
>> From: Iain Sandoe <iain@sandoe.co.uk>
>> 
>> r12-3005-g220c410162ebece4f missed a cast for the set_32 call.
>> Fixed thus.
>> 
>> Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
>> Signed-off-by: Sam James <sam@gentoo.org>
>> 
>> libiberty/ChangeLog:
>> 	PR other/112823
>> 	* simple-object-mach-o.c (simple_object_mach_o_write_segment):
>> 	Cast the first argument to set_32 as needed.
>> 
>> (cherry picked from commit 38757aa88735ab2e511bc428e2407a5a5e9fa0be)
>> ---
>> libiberty/simple-object-mach-o.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>> 
>> diff --git a/libiberty/simple-object-mach-o.c b/libiberty/simple-object-mach-o.c
>> index 72b69d19c216..a8869e7c6395 100644
>> --- a/libiberty/simple-object-mach-o.c
>> +++ b/libiberty/simple-object-mach-o.c
>> @@ -1228,7 +1228,7 @@ simple_object_mach_o_write_segment (simple_object_write *sobj, int descriptor,
>>       /* Swap the indices, if required.  */
>> 
>>       for (i = 0; i < (nsects_in * 4); ++i)
>> -	set_32 (&index[i], index[i]);
>> +	set_32 ((unsigned char *) &index[i], index[i]);
>> 
>>       sechdr_offset += sechdrsize;
>> 
>> -- 
>> 2.43.0
>>
diff mbox series

Patch

diff --git a/libiberty/simple-object-mach-o.c b/libiberty/simple-object-mach-o.c
index 72b69d19c216..a8869e7c6395 100644
--- a/libiberty/simple-object-mach-o.c
+++ b/libiberty/simple-object-mach-o.c
@@ -1228,7 +1228,7 @@  simple_object_mach_o_write_segment (simple_object_write *sobj, int descriptor,
       /* Swap the indices, if required.  */
 
       for (i = 0; i < (nsects_in * 4); ++i)
-	set_32 (&index[i], index[i]);
+	set_32 ((unsigned char *) &index[i], index[i]);
 
       sechdr_offset += sechdrsize;