git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Eric Sunshine <sunshine@sunshineco.com>
To: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Cc: "GIT Mailing-list" <git@vger.kernel.org>,
	"Junio C Hamano" <gitster@pobox.com>,
	"Ramsay Jones" <ramsay@ramsayjones.plus.com>,
	"Đoàn Trần Công Danh" <congdanhqx@gmail.com>
Subject: Re: [PATCH] sparse: allow '{ 0 }' to be used without warnings
Date: Thu, 21 May 2020 17:50:28 -0400	[thread overview]
Message-ID: <CAPig+cQsYSE30ab9qQO7V+CzAdUodpw64sCnZH+1s3oD-P6msg@mail.gmail.com> (raw)
In-Reply-To: <20200521214544.8784-1-luc.vanoostenryck@gmail.com>

On Thu, May 21, 2020 at 5:46 PM Luc Van Oostenryck
<luc.vanoostenryck@gmail.com> wrote:
> In standard C, '{ 0 }' can be used as an universal zero-initializer.
> However, Sparse complains if this is used on a type where the first
> member (possibly nested) is a pointer since Sparse purposely wants
> to warn when '0' is used to initialize a pointer type.
>
> Legitimaly, it's desirable to be able to use '{ 0 }' as an idom
> without these warnings [1,2].

s/idom/idiom/

> An option have now been added to Sparse to turn off such warnings.
> So, add this option to the SPARSE_FLAGS variable.

Do you have a reference to the commit or Sparse release notes which
mention this new option? It might be nice to include it here in the
commit message. Also, should this minimum Sparse version be mentioned
somewhere in documentation so that people invoking the "sparse"
makefile target aren't greeted with an error about
-Wno-universal-initializer being an unrecognized option (assuming that
older Sparse would complain about it)?

> [1] https://lore.kernel.org/r/e6796c60-a870-e761-3b07-b680f934c537@ramsayjones.plus.com
> [2] https://lore.kernel.org/r/xmqqd07xem9l.fsf@gitster.c.googlers.com
>
> Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>

  reply	other threads:[~2020-05-21 21:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-21 21:45 [PATCH] sparse: allow '{ 0 }' to be used without warnings Luc Van Oostenryck
2020-05-21 21:50 ` Eric Sunshine [this message]
2020-05-21 22:08   ` Junio C Hamano

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=CAPig+cQsYSE30ab9qQO7V+CzAdUodpw64sCnZH+1s3oD-P6msg@mail.gmail.com \
    --to=sunshine@sunshineco.com \
    --cc=congdanhqx@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=luc.vanoostenryck@gmail.com \
    --cc=ramsay@ramsayjones.plus.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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).