Git development
 help / color / mirror / Atom feed
From: "Đoàn Trần Công Danh" <congdanhqx@gmail.com>
To: Jeff King <peff@peff.net>
Cc: "Junio C Hamano" <gitster@pobox.com>,
	git@vger.kernel.org, "Eric Sunshine" <sunshine@sunshineco.com>,
	"Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Subject: Re: [PATCH] merge-file: fix build warning with gcc 4.8.5
Date: Sat, 30 Jul 2022 07:19:49 +0700	[thread overview]
Message-ID: <YuR5Jado2LrtZUjP@danh.dev> (raw)
In-Reply-To: <YuQ60ZUPBHAVETD7@coredump.intra.peff.net>

On 2022-07-29 15:53:53-0400, Jeff King <peff@peff.net> wrote:
> On Fri, Jul 29, 2022 at 08:48:46AM -0700, Junio C Hamano wrote:
> 
> > I think the concensus was that we should squelch the false warning
> > on older compilers with -Wno-missing-braces, but then the discussion
> > has stalled by a suggestion to introduce a way to detect older
> > compilers that is different from how we do so at the same time, and
> > went nowhere.
> > 
> > Hopefully we can add a simple -Wno-* without waiting for whole
> > config.mak thing getting revamped this time?
> 
> Perhaps this?
> 
> -- >8 --
> Subject: [PATCH] config.mak.dev: squelch -Wno-missing-braces for older gcc
> 
> Versions of gcc prior to 4.9 complain about an initialization like:
> 
>   struct inner { int x; };
>   struct outer { struct inner; };
>   struct outer foo = { 0 };
> 
> and insist on:
> 
>   struct outer foo = { { 0 } };
> 
> Newer compilers handle this just fine. And ignoring the window even on
> older compilers is fine; the resulting code is correct, but we just get
> caught by -Werror.
> 
> Let's relax this for older compilers to make developer lives easier (we
> don't care much about non-developers on old compilers; they may see a
> warning, but it won't stop compilation).
> 
> Signed-off-by: Jeff King <peff@peff.net>
> ---
> Tested on a debian jessie chroot using gcc-4.8 and 4.9. Though note that
> you also need to manually specify -std=gnu99 to get it to work at all
> with those compilers these days! So I kind of wonder if it's even worth
> catering to their warnings automatically.

Well, config.mak.uname automatically adds -std=c99 for RHEL 7 and
CentOS7. Can we add the same things for Debian? Or should we just
remove both?


-- 
Danh

  parent reply	other threads:[~2022-07-30  0:19 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-29  9:05 [PATCH] merge-file: fix build warning with gcc 4.8.5 Đoàn Trần Công Danh
2022-07-29 15:48 ` Junio C Hamano
2022-07-29 19:53   ` Jeff King
2022-07-29 19:54     ` Jeff King
2022-07-29 20:48     ` Eric Sunshine
2022-07-29 21:00       ` Jeff King
2022-07-29 21:23         ` Junio C Hamano
2022-07-30  0:19     ` Đoàn Trần Công Danh [this message]
2022-07-30  1:40       ` Jeff King
2022-07-30  1:46       ` brian m. carlson
2022-07-30 23:50         ` Jeff King

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=YuR5Jado2LrtZUjP@danh.dev \
    --to=congdanhqx@gmail.com \
    --cc=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=peff@peff.net \
    --cc=sunshine@sunshineco.com \
    /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