From: Christopher Li <sparse@chrisli.org>
To: Ben Pfaff <blp@nicira.com>
Cc: linux-sparse@vger.kernel.org
Subject: Re: [PATCH] evaluate: Allow sizeof(_Bool) to succeed.
Date: Wed, 11 May 2011 17:09:42 -0700 [thread overview]
Message-ID: <BANLkTinHEgDw24S=mcE6B7OeirrHk+ZSog@mail.gmail.com> (raw)
In-Reply-To: <20110509204937.GI2971@nicira.com>
On Mon, May 9, 2011 at 1:49 PM, Ben Pfaff <blp@nicira.com> wrote:
> The 'fault' member is 3-valued: a null pointer means that the row has
> an empty "fault" column; otherwise it points either to a malloc()'d
> true or false value. The warning then crops up in the generated code
> for populating this struct, which does something similar to the
> following when the "fault" column is nonempty:
>
> row->fault = xmalloc(sizeof *row->fault);
> *row->fault = /* value parsed from database row */;
I don't see particular things wrong with it. Personally I think malloc is
a bit overkill here. It will likely pad the area to natural machine int size
any way.
> I could change my IDL code generator to do something different for
> this case, but I don't see anything actually wrong with it. This
> userspace code is not performance-critical or sensitive to memory
> usage, so it's not necessary on the face of it to optimize it.
Removing the warning will lose the chance to see it on other potential
problematic usage. If you insist on no warning. You can submit a patch
to add a switch to disable it. We have a lot of those for fine grain warning
control. I just don't see this warning can hurt on the kernel checking side.
Chris
--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2011-05-12 0:09 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-04 23:39 [PATCH] evaluate: Allow sizeof(_Bool) to succeed Ben Pfaff
2011-05-07 20:37 ` Christopher Li
2011-05-09 20:02 ` Ben Pfaff
2011-05-09 20:31 ` Christopher Li
2011-05-09 20:49 ` Ben Pfaff
2011-05-12 0:09 ` Christopher Li [this message]
2011-05-12 20:48 ` Ben Pfaff
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='BANLkTinHEgDw24S=mcE6B7OeirrHk+ZSog@mail.gmail.com' \
--to=sparse@chrisli.org \
--cc=blp@nicira.com \
--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 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).