Re: git no longer builds on SunOS 5.10, a report

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

 



On Sun, Oct 13, 2024 at 3:57 PM Patrick Steinhardt <ps@xxxxxx> wrote:
> diff --git a/t/unit-tests/clar/clar.c b/t/unit-tests/clar/clar.c
> index cef0f023c2..064ca5c2ea 100644
> --- a/t/unit-tests/clar/clar.c
> +++ b/t/unit-tests/clar/clar.c
> @@ -4,6 +4,10 @@
>   * This file is part of clar, distributed under the ISC license.
>   * For full terms see the included COPYING file.
>   */
> +
> +#define _DARWIN_C_SOURCE
> +#define _POSIX_C_SOURCE=200809L

token "=" is not valid in preprocessor expressions.

2008 postdates my available compiler by many years, so trying to define this
is not going to get you everything you might expect here.

Fixing the #define to use a space and not = results in

/usr/include/sys/feature_tests.h:332:2: #error "Compiler or options
invalid for pre-UNIX 03 X/Open applications and pre-2001 POSIX
applications"

The relevant bits of the header:

#if defined(_STDC_C99) && (defined(__XOPEN_OR_POSIX) && !defined(_XPG6))
#error "Compiler or options invalid for pre-UNIX 03 X/Open applications \
        and pre-2001 POSIX applications"
#elif !defined(_STDC_C99) && \
        (defined(__XOPEN_OR_POSIX) && defined(_XPG6))
#error "Compiler or options invalid; UNIX 03 and POSIX.1-2001 applications \
        require the use of c99"
#endif

Removing `#define _POSIX_C_SOURCE 200809L` results in successful compilation.

> +
>  #include <assert.h>
>  #include <setjmp.h>
>  #include <stdlib.h>
> @@ -271,9 +275,7 @@ static double clar_time_diff(clar_time *start, clar_time *end)
>
>  static void clar_time_now(clar_time *out)
>  {
> -       struct timezone tz;
> -
> -       gettimeofday(out, &tz);
> +       gettimeofday(out, NULL);
>  }
>
>  static double clar_time_diff(clar_time *start, clar_time *end)
> diff --git a/t/unit-tests/clar/clar/sandbox.h b/t/unit-tests/clar/clar/sandbox.h
> index e25057b7c4..b499d2e1e6 100644
> --- a/t/unit-tests/clar/clar/sandbox.h
> +++ b/t/unit-tests/clar/clar/sandbox.h
> @@ -122,7 +122,7 @@ static int build_sandbox_path(void)
>
>         if (mkdir(_clar_path, 0700) != 0)
>                 return -1;
> -#elif defined(__TANDEM)
> +#elif defined(__sunos) || defined(__TANDEM)

I think we want __sun here, not __sunos.

>         if (mktemp(_clar_path) == NULL)
>                 return -1;
>

-Alejandro





[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux