bug-gnulib
[Top][All Lists]
Advanced

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

Re: [PATCH] timeout: support sub-second timeouts on macOS


From: Jim Meyering
Subject: Re: [PATCH] timeout: support sub-second timeouts on macOS
Date: Mon, 9 Nov 2020 09:06:23 -0800

On Mon, Nov 9, 2020 at 5:17 AM Pádraig Brady <P@draigbrady.com> wrote:
> On 09/11/2020 01:33, Jim Meyering wrote:
> > On Sun, Nov 8, 2020 at 1:26 PM Pádraig Brady <P@draigbrady.com> wrote:
> >> On 08/11/2020 18:52, Jim Meyering wrote:
> >>> On Sat, Nov 7, 2020 at 2:08 PM Pádraig Brady <P@draigbrady.com> wrote:
> >>>> * m4/jm-macros.m4: Check for setitimer.
> >>>> * src/timeout.c: Use setitimer if timer_settime is not available.
> >>>> * NEWS: Mention the improvement.
> >>>
> >>> Thanks!  The patch looks fine and I confirmed it works.
> >>> I encountered a few hurdles to make everything build using Xcode-12.1:
> >>> - I had brew's bison-2.3, but that didn't work (failed to create
> >>> lib/parse-datetime.c). fixed by installing bison-3.7.3
> >>> - compile error due to gnulib's lib/mgetgroups.c. I worked around it
> >>> by adding a gross cast. I doubt that's proper, but I haven't dug
> >>> enough to say more.
> >>>
> >>> diff --git a/lib/mgetgroups.c b/lib/mgetgroups.c
> >>> index 3377d7bb2..a27da05e5 100644
> >>> --- a/lib/mgetgroups.c
> >>> +++ b/lib/mgetgroups.c
> >>> @@ -93,7 +93,7 @@ mgetgroups (char const *username, gid_t gid, gid_t 
> >>> **groups)
> >>>              int last_n_groups = max_n_groups;
> >>>
> >>>              /* getgrouplist updates max_n_groups to num required.  */
> >>> -          ng = getgrouplist (username, gid, g, &max_n_groups);
> >>> +          ng = getgrouplist (username, gid, (int *) g, &max_n_groups);
> >>>
> >>>              /* Some systems (like Darwin) have a bug where they
> >>>                 never increase max_n_groups.  */
> >>>
> >>> - finally, I normally configure with --enable-gcc-warnings, but that
> >>> evokes the attached errors, so I got past that by building with
> >>> WERROR_CFLAGS=
> >>>
> >>
> >> Thanks for all the checking.
> >> I just used a dist tarball to check.
> >>
> >> Re getgrouplist, that was looked extensively at in:
> >> https://bugs.gnu.org/20923
> >> Is the __GNUC__ define used there different for your case?
> >
> > Yes, this version of xcode declares itself as GCC 4.2.1:
> > [Two other solutions: use GCC or do not to use --enable-gcc-warnings]
> >
> > $ :|gcc -E -dD -|grep GNUC
> > #define __GNUC__ 4
> > #define __GNUC_MINOR__ 2
> > #define __GNUC_PATCHLEVEL__ 1
> > #define __GNUC_STDC_INLINE__ 1
>
> The attached disables the mgetgroups warning for any __clang__.
> Does that address the issue directly?

Perfect. I confirm that fixes it.
Thanks!



reply via email to

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