From: Ingo Molnar <mingo@elte.hu>
To: Andrew Morton <akpm@osdl.org>
Cc: Roman Zippel <zippel@linux-m68k.org>,
tglx@linutronix.de, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 02/13] hrtimer: remove useless const
Date: Mon, 13 Feb 2006 20:59:20 +0100 [thread overview]
Message-ID: <20060213195920.GC30679@elte.hu> (raw)
In-Reply-To: <20060213115248.2f6445f4.akpm@osdl.org>
* Andrew Morton <akpm@osdl.org> wrote:
> Roman Zippel <zippel@linux-m68k.org> wrote:
> >
> > On Mon, 13 Feb 2006, Andrew Morton wrote:
> >
> > > const arguments to functions are pretty useful for code readability and
> > > maintainability too, if you use them consistently.
> >
> > I could understand that argument, if gcc would warn about it in any way.
>
> It does. If a function tries to modify a formal argument which was
> marked const you'll get a warning.
>
> We're talking about different things here. My point is that it is
> perverted and evil for a function to modify its own args (unless it's
> very small and simple), and a const declaration is a useful way for a
> maintenance programmer to be assured that nobody has done perverted
> and evil things to a function.
good point. I dont think it's "evil" (or as Roman has put it, "bogus")
in any way, and it should be up to the authors of the code to decide one
way or another. [An added bonus for me is that in my editor the 'const'
keyword is color highlighted, so const args are visually separate from
non-const arguments]
Ingo
next prev parent reply other threads:[~2006-02-13 20:01 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-02-13 1:09 [PATCH 02/13] hrtimer: remove useless const Roman Zippel
2006-02-13 11:28 ` Thomas Gleixner
2006-02-13 11:38 ` Roman Zippel
2006-02-13 11:46 ` Ingo Molnar
2006-02-13 11:53 ` Andrew Morton
2006-02-13 12:18 ` Roman Zippel
2006-02-13 12:30 ` Andrew Morton
2006-02-13 12:50 ` Roman Zippel
2006-02-13 19:52 ` Andrew Morton
2006-02-13 19:59 ` Ingo Molnar [this message]
2006-02-13 20:03 ` linux-os (Dick Johnson)
2006-02-13 21:21 ` Andrew Morton
2006-02-13 21:57 ` Roman Zippel
2006-02-13 12:09 ` Roman Zippel
2006-02-13 12:26 ` Roman Zippel
2006-02-13 15:54 ` Roman Zippel
2006-02-13 20:35 ` Andrew Morton
2006-02-13 22:01 ` Roman Zippel
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=20060213195920.GC30679@elte.hu \
--to=mingo@elte.hu \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tglx@linutronix.de \
--cc=zippel@linux-m68k.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.