mbox series

[0/2] C99: harder dependency on variadic macros

Message ID cover-0.2-00000000000-20210412T105422Z-avarab@gmail.com (mailing list archive)
Headers show
Series C99: harder dependency on variadic macros | expand

Message

Ævar Arnfjörð Bjarmason April 12, 2021, 11:02 a.m. UTC
Since [1] which has been out since v2.31.0 we've had a hard dependency
on variadic macros.

Removing the relevant always-off-unless-you-monkeypatch-the-source
code may be too aggressive for Junio's "Let's give it enough time"[2].

But I'm submitting this because of brian m. carlson's note[3] about
wanting to submit more general patches for declaring a hard dependency
on all of C99.

Whatever anyone thinks of that this harder dependency on C99 variadic
macros would be a subset of such a change, so it makes sense to
consider it first. Let's see if anyone has an issue with this landing
before brian's suggested larger change.

1. https://lore.kernel.org/git/YBJLgY+CWtS9TeVb@coredump.intra.peff.net/
2. https://lore.kernel.org/git/xmqq5z3hy4fq.fsf@gitster.c.googlers.com/
3. https://lore.kernel.org/git/YHOLo36MfuTj6YeD@camp.crustytoothpaste.net/

Ævar Arnfjörð Bjarmason (2):
  git-compat-util.h: clarify comment on GCC-specific code
  C99 support: remove non-HAVE_VARIADIC_MACROS code

 Documentation/CodingGuidelines |  3 ++
 banned.h                       |  5 ---
 git-compat-util.h              | 25 +++++-------
 trace.c                        | 73 ----------------------------------
 trace.h                        | 62 -----------------------------
 trace2.c                       | 39 ------------------
 trace2.h                       | 25 ------------
 usage.c                        | 10 -----
 8 files changed, 12 insertions(+), 230 deletions(-)

Comments

Bagas Sanjaya April 12, 2021, 12:14 p.m. UTC | #1
On 12/04/21 18.02, Ævar Arnfjörð Bjarmason wrote:
> But I'm submitting this because of brian m. carlson's note[3] about
> wanting to submit more general patches for declaring a hard dependency
> on all of C99.

I think we should bump standard requirement to C99, right?
Ævar Arnfjörð Bjarmason April 12, 2021, 12:41 p.m. UTC | #2
On Mon, Apr 12 2021, Bagas Sanjaya wrote:

> On 12/04/21 18.02, Ævar Arnfjörð Bjarmason wrote:
>> But I'm submitting this because of brian m. carlson's note[3] about
>> wanting to submit more general patches for declaring a hard dependency
>> on all of C99.
>
> I think we should bump standard requirement to C99, right?

I think that's worth discussing, but isn't the topic of this more narrow
change.

As noted in
http://lore.kernel.org/git/87wnt8eai1.fsf@evledraar.gmail.com if we
simply do that some of our MSVC CI will start failing.

I don't know what other compilers we need to support that may support
our current subset of C99 features, but not the full set, or if e.g. the
CI can simply have its MSVC compiler version bumped.
brian m. carlson April 12, 2021, 10:57 p.m. UTC | #3
On 2021-04-12 at 12:41:35, Ævar Arnfjörð Bjarmason wrote:
> 
> On Mon, Apr 12 2021, Bagas Sanjaya wrote:
> 
> > On 12/04/21 18.02, Ævar Arnfjörð Bjarmason wrote:
> >> But I'm submitting this because of brian m. carlson's note[3] about
> >> wanting to submit more general patches for declaring a hard dependency
> >> on all of C99.
> >
> > I think we should bump standard requirement to C99, right?
> 
> I think that's worth discussing, but isn't the topic of this more narrow
> change.

I'm in favor of this more narrow change as well.

Junio's statement that packages may not have had time to update is true,
but I also just looked at a variety of packages that run on Linux,
FreeBSD, and NetBSD (and, since it's pkgsrc, Solaris), and they're all
updated.  Usually most open source OS vendors are reasonably prompt
about updating their Git versions, at least in the bleeding edge
repositories.

If this works on Windows, it will also work on Unix, because POSIX has
required C99 support since the 2001 revision, and __VA_ARGS__ is C99.
Unix systems are not the thing preventing us from enabling C99 support
(or any subset of it) in any meaningful sense.

> As noted in
> http://lore.kernel.org/git/87wnt8eai1.fsf@evledraar.gmail.com if we
> simply do that some of our MSVC CI will start failing.
> 
> I don't know what other compilers we need to support that may support
> our current subset of C99 features, but not the full set, or if e.g. the
> CI can simply have its MSVC compiler version bumped.

I'm looking at fixing our CI before I send in my series.  My series,
when it comes in, will have a green CI status because I do want to be
sure that we're providing a supported environment for MSVC wherever
that's possible.
Junio C Hamano April 12, 2021, 11:19 p.m. UTC | #4
"brian m. carlson" <sandals@crustytoothpaste.net> writes:

> If this works on Windows, it will also work on Unix, because POSIX has
> required C99 support since the 2001 revision, and __VA_ARGS__ is C99.
> Unix systems are not the thing preventing us from enabling C99 support
> (or any subset of it) in any meaningful sense.

Yeah, among the list (semi-)regulars, the only ones that may likely
to be broken is the NonStop folks.  Hopefully they are aware of this
discussion?

https://lore.kernel.org/git/xmqqeeffe669.fsf@gitster.g/