> On 3 Apr 2021, at 20:22, Warner Losh <i...@bsdimp.com> wrote:
>
> What's the error if you don't have these extra uintptr_t casts?
--- getgrent.o ---
*** [getgrent.o] Error code 1
make[4]: stopped in /h/rnd/git/stable/13/lib/libc
--- getpwent.o ---
/h/rnd/git/stable/13/lib/libc/gen/getpwent.c:1111:8: error: cast to smaller
integer type 'enum nss_lookup_type' from 'void *'
[-Werror,-Wvoid-pointer-to-enum-cast]
how = (enum nss_lookup_type)mdata;
^~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
>
> Warner
>
> On Sat, Apr 3, 2021 at 12:18 AM Daniel Braniss <da...@cs.huji.ac.il
> <mailto:da...@cs.huji.ac.il>> wrote:
> I must be the last person on earth to use Hesiod :-)
> this are the diffs:
>
> diff --git a/lib/libc/gen/getgrent.c b/lib/libc/gen/getgrent.c
> index afb89cab3..5832cb8c6 100644
> --- a/lib/libc/gen/getgrent.c
> +++ b/lib/libc/gen/getgrent.c
> @@ -971,7 +971,7 @@ dns_group(void *retval, void *mdata, va_list ap)
> hes = NULL;
> name = NULL;
> gid = (gid_t)-1;
> - how = (enum nss_lookup_type)mdata;
> + how = (enum nss_lookup_type)(uintptr_t)mdata;
> switch (how) {
> case nss_lt_name:
> name = va_arg(ap, const char *);
> diff --git a/lib/libc/gen/getpwent.c b/lib/libc/gen/getpwent.c
> index a07ee109e..bc1d341fd 100644
> --- a/lib/libc/gen/getpwent.c
> +++ b/lib/libc/gen/getpwent.c
> @@ -1108,7 +1108,7 @@ dns_passwd(void *retval, void *mdata, va_list ap)
> hes = NULL;
> name = NULL;
> uid = (uid_t)-1;
> - how = (enum nss_lookup_type)mdata;
> + how = (enum nss_lookup_type)(uintptr_t)mdata;
> switch (how) {
> case nss_lt_name:
> name = va_arg(ap, const char *);
>
>
> _______________________________________________
> freebsd-stable@freebsd.org <mailto:freebsd-stable@freebsd.org> mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-stable
> <https://lists.freebsd.org/mailman/listinfo/freebsd-stable>
> To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org
> <mailto:freebsd-stable-unsubscr...@freebsd.org>"
_______________________________________________
freebsd-stable@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"