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: Thu, 28 May 2020 22:31:58 +0000	[thread overview]
Message-ID: <bug-207959-200559-E7pP0OflsO@https.bugzilla.kernel.org/> (raw)
In-Reply-To: <bug-207959-200559@https.bugzilla.kernel.org/>

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

Linus Torvalds (torvalds@linux-foundation.org) changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |torvalds@linux-foundation.o
                   |                            |rg

--- Comment #5 from Linus Torvalds (torvalds@linux-foundation.org) ---
That said, I'm not sure the kernel cares. If sparse makes '{ 0 }' be eqivalent
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. 

For something like a silly zero struct initializer it's not like it's the end
of the world. I do find the whole "0 could be a pointer, and NULL could be used
for an integer or float" to be very distasteful, and the C++ people in
particular were in denial about their brokenness for much much too long.

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

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

  parent reply	other threads:[~2020-05-28 22:31 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 [this message]
2020-05-28 22:47 ` bugzilla-daemon
2020-05-29 19:35 ` bugzilla-daemon
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-E7pP0OflsO@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.