All of lore.kernel.org
 help / color / mirror / Atom feed
From: bugzilla-daemon@bugzilla.kernel.org
To: linux-sparse@vger.kernel.org
Subject: [Bug 207959] Don't warn about the universal zero initializer for a structure with the 'designated_init' attribute.
Date: Fri, 29 May 2020 19:35:42 +0000	[thread overview]
Message-ID: <bug-207959-200559-9knJuBqKx9@https.bugzilla.kernel.org/> (raw)
In-Reply-To: <bug-207959-200559@https.bugzilla.kernel.org/>

https://bugzilla.kernel.org/show_bug.cgi?id=207959

--- Comment #7 from Luc Van Oostenryck (luc.vanoostenryck@gmail.com) ---
(In reply to Linus Torvalds from comment #5)
> That said, I'm not sure the kernel cares. If sparse makes '{ 0 }' be
> equivalent to '{ }' and doesn't warn for it, it's not like it's a huge deal.
> 
> The problem with using 0 instead of NULL (or vice versa, which is a crime,
> and which is why NULL should never have been defined to plain 0) comes when
> it is actually confusing.

OK. I also detest this 'you can use 0 for pointers' but I think that '{ 0 }'
should just be understood as the standard idiom for '{ }' and that the current
situation where '{ 0 }' gives warnings while '{ }' doesn't s confusing and
annoying. So, I'll change Sparse's default to -Wno-universal-initializer.

> So I'd prefer the "0 for NULL" warning, even if this may not be the most
> important case for it.

Do you think it's worth to add -Wuniversal-initializer for the kernel so that
these warnings are still present for '{ 0 }'?

-- Luc

-- 
You are receiving this mail because:
You are watching the assignee of the bug.

  parent reply	other threads:[~2020-05-29 19:35 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-28 16:27 [Bug 207959] New: Don't warn about the universal zero initializer for a structure with the 'designated_init' attribute bugzilla-daemon
2020-05-28 19:22 ` [Bug 207959] " bugzilla-daemon
2020-05-28 19:57 ` [Bug 207959] New: " Ramsay Jones
2020-05-28 20:52 ` [Bug 207959] " bugzilla-daemon
2020-05-28 21:24 ` bugzilla-daemon
2020-05-28 22:25   ` Linus Torvalds
2020-05-28 22:26 ` bugzilla-daemon
2020-05-28 22:31 ` bugzilla-daemon
2020-05-28 22:47 ` bugzilla-daemon
2020-05-29 19:35 ` bugzilla-daemon [this message]
2020-05-29 19:47 ` bugzilla-daemon
2020-06-08  7:53 ` bugzilla-daemon

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=bug-207959-200559-9knJuBqKx9@https.bugzilla.kernel.org/ \
    --to=bugzilla-daemon@bugzilla.kernel.org \
    --cc=linux-sparse@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.