From: Johannes Sixt <j6t@kdbg.org>
To: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Cc: "Junio C Hamano" <gitster@pobox.com>,
"Ben Peart" <peartben@gmail.com>, "Jeff King" <peff@peff.net>,
"René Scharfe" <l.s.r@web.de>,
"Andreas Schwab" <schwab@linux-m68k.org>,
"Git List" <git@vger.kernel.org>
Subject: Re: [PATCH] strbuf: use designated initializers in STRBUF_INIT
Date: Fri, 14 Jul 2017 00:24:43 +0200 [thread overview]
Message-ID: <2f7f7af2-585c-9374-34e3-e34680678935@kdbg.org> (raw)
In-Reply-To: <87d195zcy0.fsf@gmail.com>
Am 12.07.2017 um 21:12 schrieb Ævar Arnfjörð Bjarmason:
> I think in the context of this desire Johannes Sixt's "Actually, I'm
> serious [about let's compile with c++]"[1] should be given some more
> consideration.
Thank you for your support.
> I've just compiled Git with it and it passes all tests. I think the
> endeavor is worthwhile in itself as C++ source-level compatibility for
> git.git is clearly easy to achieve, and would effectively give us access
> to more compilers (albeit in different modes, but they may discover
> novel bugs that also apply to the C mode code).
Please keep in mind that my patches only show that it can be done.
Nevertheless, the result is far, far away from valid C++ code. It can be
compiled by GCC (thanks to its -fpermissive flag) and happens to produce
something that works. But that does not mean that other compilers would
grok it.
Source-level compatibility is only necessary as a stop gap in the
transition to C++. If the transition is not going to happen, I doubt
that there is any value. It is simply too much code churn for too little
gain. The real gains are in the features of C++(11,14).
> But why do it? Aside from the "more compilers" argument, we may find
> that it's going to be much easier to use some C99 features we want by
> having C++ source-level compatibility, and on compilers like that may
> not support those features in C use the C++ mode that may support those.
I would be happy to learn about a C99 feature where C++ mode of some
compiler would help.
The only C99 feature mentioned so far was designated initializers.
Unfortunately, that actually widens the gap between C and C++, not
lessens it. (C++ does not have designated initializers, and they are not
on the agenda.)
> If not C++ support would be interesting for other reasons. Johannes
> Sixt: It would be very nice to get those patches on-list.
I don't think it's worth to swamp the list with the patches at this
time. Interested parties can find them here:
https://github.com/j6t/git.git c-plus-plus
I may continue the work, slowly and as long as I find it funny. It's
just mental exercise, unless the Git community copies the GCC Steering
Committee's mindeset with regard to C++ in the code base
(https://gcc.gnu.org/ml/gcc/2010-05/msg00705.html).
-- Hannes
next prev parent reply other threads:[~2017-07-13 22:24 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-10 7:03 [PATCH] strbuf: use designated initializers in STRBUF_INIT Jeff King
2017-07-10 14:57 ` Ben Peart
2017-07-10 16:04 ` Jeff King
2017-07-10 17:57 ` Ben Peart
2017-07-11 5:01 ` Mike Hommey
2017-07-11 15:31 ` Junio C Hamano
2017-07-12 19:12 ` Ævar Arnfjörð Bjarmason
2017-07-12 21:08 ` Junio C Hamano
2017-07-13 22:24 ` Johannes Sixt [this message]
2017-07-10 16:44 ` Junio C Hamano
2017-07-10 17:33 ` Stefan Beller
2017-07-10 21:46 ` Junio C Hamano
2017-07-10 17:10 ` Andreas Schwab
2017-07-10 19:57 ` Johannes Sixt
2017-07-10 20:38 ` Junio C Hamano
2017-07-10 21:11 ` Johannes Sixt
2017-07-10 21:38 ` Junio C Hamano
2017-07-14 16:11 ` Junio C Hamano
2017-07-14 17:13 ` Stefan Beller
2017-07-14 17:36 ` Jeff King
2017-07-14 18:48 ` Junio C Hamano
2017-07-14 19:16 ` Junio C Hamano
2017-07-19 18:19 ` [PATCH] objects: scope count variable to loop Stefan Beller
2017-07-19 18:23 ` Brandon Williams
2017-07-24 17:08 ` Jeff King
2017-07-24 17:12 ` Stefan Beller
2017-07-24 18:05 ` Jeff King
2017-07-14 19:28 ` [PATCH] strbuf: use designated initializers in STRBUF_INIT Ævar Arnfjörð Bjarmason
2017-07-14 22:26 ` Junio C Hamano
2017-07-14 22:43 ` Mike Hommey
2017-07-15 11:08 ` Jeff King
2017-07-11 4:38 ` Jeff King
2017-07-11 0:05 ` brian m. carlson
2017-07-11 0:07 ` Stefan Beller
2017-07-11 0:10 ` brian m. carlson
2017-07-11 5:24 ` Johannes Sixt
2017-07-12 1:26 ` brian m. carlson
2017-07-12 18:25 ` Johannes Sixt
2017-07-10 22:41 ` Brandon Williams
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=2f7f7af2-585c-9374-34e3-e34680678935@kdbg.org \
--to=j6t@kdbg.org \
--cc=avarab@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=l.s.r@web.de \
--cc=peartben@gmail.com \
--cc=peff@peff.net \
--cc=schwab@linux-m68k.org \
/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).