public inbox for linux-kbuild@vger.kernel.org
 help / color / mirror / Atom feed
From: Michal Marek <mmarek@suse.cz>
To: Jean Sacren <sakiwit@gmail.com>
Cc: Arnaud Lacombe <lacombar@gmail.com>,
	Reinhard Tartler <Reinhard.Tartler@informatik.uni-erlangen.de>,
	linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org,
	amwang@redhat.com
Subject: Re: [PATCH] kbuild: Fix compiler warning with assertion when calling 'fwrite'
Date: Sun, 15 Jan 2012 00:19:03 +0100	[thread overview]
Message-ID: <20120114231902.GB19267@sepie.suse.cz> (raw)
In-Reply-To: <20111125234253.GD14454@mail.gmail.com>

On Fri, Nov 25, 2011 at 04:42:53PM -0700, Jean Sacren wrote:
> Reinhard Tartler discovered a corner case of calling xfwrite() where the
> length of the string is zero.
> 
> Arnaud Lacombe suggested to use assertion for the corner case, as
> fwrite(3) is currently used:
> 
>  1) in comment printers. Empty comment are not allowed.
>  2) in a callback passed to expr_print(), where the string printed is
>     either NULL OR non-empty.
>  3) in the lexer, auto-generated, and unused.
> 
> I feel using assertion is a good solution:
> 
>  1) It cleanly takes care of the above-mentioned corner case.
>  2) It can be easily disabled by defining NDEBUG.
>  3) It asserts xfwrite() is simply a wrapper for fwrite().
> 
> Reported-by: Reinhard Tartler <Reinhard.Tartler@informatik.uni-erlangen.de>
> Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>
> Signed-off-by: Jean Sacren <sakiwit@gmail.com>

Applied to kbuild.git#kconfig.

Michal

      reply	other threads:[~2012-01-14 23:19 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-06 11:14 [PATCH] kconfig: Fix checking return value of 'fwrite' Reinhard Tartler
2011-10-07  2:34 ` Cong Wang
2011-10-07  3:29 ` Arnaud Lacombe
2011-11-20 13:24   ` Michal Marek
2011-11-20 15:53     ` Reinhard Tartler
2011-11-23  5:53     ` Jean Sacren
2011-11-23  6:30       ` Reinhard Tartler
2011-11-23 18:05         ` Arnaud Lacombe
2011-11-25 23:42           ` [PATCH] kbuild: Fix compiler warning with assertion when calling 'fwrite' Jean Sacren
2012-01-14 23:19             ` Michal Marek [this message]

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=20120114231902.GB19267@sepie.suse.cz \
    --to=mmarek@suse.cz \
    --cc=Reinhard.Tartler@informatik.uni-erlangen.de \
    --cc=amwang@redhat.com \
    --cc=lacombar@gmail.com \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sakiwit@gmail.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