bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 01/41] libshouldbeinlibc: Port to x86_64


From: Sergey Bugaev
Subject: Re: [PATCH 01/41] libshouldbeinlibc: Port to x86_64
Date: Tue, 9 May 2023 00:44:57 +0300

On Tue, May 9, 2023 at 12:40 AM Samuel Thibault <samuel.thibault@gnu.org> wrote:
> > -  size_t opts_len = sizeof opts;
> > +  mach_msg_type_number_t opts_len = sizeof opts;
>
> ? That doesn't make sense, sizeof does return size_t.

sizeof returns size_t, yes. But this code later passes opts_len *by
pointer* to fsys_get_options (), which expects a value of type
mach_msg_type_number_t (or a pointer to that, rather).

So the fix here is not that the value sizeof evaluates to was being
saved to a wrong type, but that a wrong type was being passed to a
Mach RPC. I'm now casting the result of sizeof from size_t to
mach_msg_type_number_t, and passing that to fsys_get_options ().

I hope this makes sense now; and you're going to see *a lot* of
similar changes in this patchset.

Sergey



reply via email to

[Prev in Thread] Current Thread [Next in Thread]