From: Ingo Oeser <ioe-lkml@rameria.de>
To: Andreas Schwab <schwab@suse.de>
Cc: Amit Choudhary <amit2030@yahoo.com>,
Bernd Petrovitsch <bernd@firmix.at>,
Jan Engelhardt <jengelh@linux01.gwdg.de>,
Pavel Machek <pavel@ucw.cz>,
Linux Kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] [DISCUSS] Make the variable NULL after freeing it.
Date: Mon, 1 Jan 2007 22:40:58 +0100 [thread overview]
Message-ID: <200701012241.08240.ioe-lkml@rameria.de> (raw)
In-Reply-To: <je3b6uhfz4.fsf@sykes.suse.de>
[-- Attachment #1: Type: text/plain, Size: 896 bytes --]
On Monday, 1. January 2007 17:25, Andreas Schwab wrote:
> Ingo Oeser <ioe-lkml@rameria.de> writes:
> > Then this works, because the side effect (+20) is evaluated only once.
>
> It's not a side effect, it's a non-lvalue, and you can't take the address
> of a non-lvalue.
Just verified this. So If we cannot make it work in all cases, it will
cause more problems then it will solve.
So we are left with a function, which will
a) only be used by janitors to provide "kfree(x); x = NULL;"
with an macro KFREE(x) in all the simple cases.
b) be used by developers, who are aware of the fact that reusable
pointer values should set to NULL after kfree().
Doing a) and b) is "running into open doors", so doesn't prevent any
error, obfuscates code more and works only sometimes.
I give up here and would vote for dropping that idea then.
Regards
Ingo Oeser
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
next prev parent reply other threads:[~2007-01-01 21:41 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-12-21 23:41 Amit Choudhary
2006-12-27 17:10 ` Pavel Machek
2006-12-28 8:54 ` Jan Engelhardt
2006-12-31 13:38 ` Bernd Petrovitsch
2007-01-01 0:43 ` Ingo Oeser
2007-01-01 1:05 ` YOSHIFUJI Hideaki / 吉藤英明
2007-01-01 6:37 ` Amit Choudhary
2007-01-01 16:09 ` Ingo Oeser
2007-01-01 16:25 ` Andreas Schwab
2007-01-01 21:40 ` Ingo Oeser [this message]
2007-01-01 21:42 ` Jan Engelhardt
2007-01-01 18:36 ` Pavel Machek
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=200701012241.08240.ioe-lkml@rameria.de \
--to=ioe-lkml@rameria.de \
--cc=amit2030@yahoo.com \
--cc=bernd@firmix.at \
--cc=jengelh@linux01.gwdg.de \
--cc=linux-kernel@vger.kernel.org \
--cc=pavel@ucw.cz \
--cc=schwab@suse.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®