mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Reinhard Tartler <Reinhard.Tartler@informatik.uni-erlangen.de>
To: Jean Sacren <sakiwit@gmail.com>
Cc: Michal Marek <mmarek@suse.cz>,
	Arnaud Lacombe <lacombar@gmail.com>,
	linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org,
	vamos-dev@lists.informatik.uni-erlangen.de, amwang@redhat.com
Subject: Re: [PATCH] kconfig: Fix checking return value of 'fwrite'
Date: Wed, 23 Nov 2011 07:30:56 +0100	[thread overview]
Message-ID: <877h2r1hb3.fsf@faui43f.informatik.uni-erlangen.de> (raw)
In-Reply-To: <20111123055351.GB14454@mail.gmail.com> (Jean Sacren's message of "Tue, 22 Nov 2011 22:53:51 -0700")

On Mi, Nov 23, 2011 at 06:53:51 (CET), Jean Sacren wrote:

> From: Michal Marek <mmarek@suse.cz>
> Date: Sun, 20 Nov 2011 14:24:35 +0100
>>
>> On 7.10.2011 05:29, Arnaud Lacombe wrote:
>> > Hi,
>> > 
>> > 2011/10/6 Reinhard Tartler <Reinhard.Tartler@informatik.uni-erlangen.de>:
>> >> fwrite indicates '1' written member if a zero-length string is written.
>> > you forgot the "Signed-off-by: " part :)
>> 
>> Reinhard, can I assume
>> 
>> Signed-off-by: Reinhard Tartler
>> <Reinhard.Tartler@informatik.uni-erlangen.de>
>> 
>> ? The patch is otherwise correct.
>
> I have two reasons to oppose this patch.
>
> 1. If 'len' value is zero, there is an issue already and it should be
> taken care of _before_ calling fwrite().

So you're saying the function assumes a non-empty string? Why? It is a
simple "writing-helper" and this seems a perfectly valid corner case to
me.  Can you perhaps elaborate why you consider this corner case invalid
and require (possibly out-of-tree) callers to check this for themselves?

> 2. xfwrite() doesn't fix anything except for the compiler warning. It
> assumes this world is perfect and it's definitely not a place to take
> care of the zero-length string.

It seems to me that you rather oppose to the introduction of xfwrite()
than to the patch here at hand. Is that correct?

Cheers,
Reinhard

-- 
Reinhard Tartler                     Department of Computer Science IV
Martensstr 1, 91058 Erlangen Germany, University of Erlangen-Nuremberg
            http://www4.informatik.uni-erlangen.de/~tartler

  reply	other threads:[~2011-11-23  6:34 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-06 11:14 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 [this message]
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

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=877h2r1hb3.fsf@faui43f.informatik.uni-erlangen.de \
    --to=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=mmarek@suse.cz \
    --cc=sakiwit@gmail.com \
    --cc=vamos-dev@lists.informatik.uni-erlangen.de \
    /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

all inboxes | Powered by JetHome®