git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Alejandro R. Sedeño" <asedeno@mit.edu>
To: Patrick Steinhardt <ps@pks.im>
Cc: Git List <git@vger.kernel.org>,
	Johannes Schindelin <Johannes.Schindelin@gmx.de>
Subject: Re: git no longer builds on SunOS 5.10, a report
Date: Sun, 13 Oct 2024 18:50:09 -0400	[thread overview]
Message-ID: <CAOO-Oz2gN1Y9h-p_AJ=7iKzxOK2ShmgEmWzpFrpwwAD2GH=6TQ@mail.gmail.com> (raw)
In-Reply-To: <ZwwmFtF1Y30y8eoU@pks.im>

On Sun, Oct 13, 2024 at 3:57 PM Patrick Steinhardt <ps@pks.im> 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

  reply	other threads:[~2024-10-13 22:50 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-12  2:10 git no longer builds on SunOS 5.10, a report Alejandro R. Sedeño
2024-10-12  8:19 ` Patrick Steinhardt
2024-10-12 14:34   ` Alejandro R. Sedeño
2024-10-12 14:40     ` [PATCH] Makefile: adjust sed command for generating "clar-decls.h" Alejandro R. Sedeño
2024-10-12 14:42     ` git no longer builds on SunOS 5.10, a report Alejandro R. Sedeño
2024-10-13 19:57     ` Patrick Steinhardt
2024-10-13 22:50       ` Alejandro R. Sedeño [this message]
2024-10-14  6:20         ` Patrick Steinhardt
2024-10-14 11:45 ` [PATCH 0/2] t/unit-tests: improve clar platform compatibility Patrick Steinhardt
2024-10-14 11:45   ` [PATCH 1/2] t/unit-tests: update clar to 0810a36 Patrick Steinhardt
2024-10-14 11:45   ` [PATCH 2/2] Makefile: adjust sed command for generating "clar-decls.h" Patrick Steinhardt
2024-10-18 15:45     ` Toon Claes
2024-10-18 21:14       ` Taylor Blau
2024-10-21  7:00         ` Patrick Steinhardt
2024-10-21 10:56 ` [PATCH v2 0/5] t/unit-tests: improve clar platform compatibility Patrick Steinhardt
2024-10-21 10:56   ` [PATCH v2 1/5] t/unit-tests: update clar to 206accb Patrick Steinhardt
2024-10-21 10:56   ` [PATCH v2 2/5] Makefile: adjust sed command for generating "clar-decls.h" Patrick Steinhardt
2024-10-21 11:07     ` Kristoffer Haugsbakk
2024-10-21 11:35       ` Patrick Steinhardt
2024-10-21 10:56   ` [PATCH v2 3/5] Makefile: extract script to generate clar declarations Patrick Steinhardt
2024-10-21 10:56   ` [PATCH v2 4/5] cmake: fix compilation of clar-based unit tests Patrick Steinhardt
2024-10-21 10:56   ` [PATCH v2 5/5] cmake: set up proper dependencies for generated clar headers Patrick Steinhardt
2024-11-05 19:55     ` Johannes Schindelin
2024-11-06 10:59       ` Phillip Wood
2024-11-08 12:59         ` Patrick Steinhardt
2024-10-21 20:52   ` [PATCH v2 0/5] t/unit-tests: improve clar platform compatibility Taylor Blau
2024-10-25 12:17   ` karthik nayak
2024-10-26  5:01   ` Bagas Sanjaya
2024-10-27 13:01     ` Patrick Steinhardt
2024-10-27 23:56       ` Taylor Blau

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAOO-Oz2gN1Y9h-p_AJ=7iKzxOK2ShmgEmWzpFrpwwAD2GH=6TQ@mail.gmail.com' \
    --to=asedeno@mit.edu \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=ps@pks.im \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).