Roman Zippel <[email protected]> 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. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
- Follow-Ups:
- Re: [PATCH 02/13] hrtimer: remove useless const
- From: Roman Zippel <[email protected]>
- Re: [PATCH 02/13] hrtimer: remove useless const
- From: "linux-os \(Dick Johnson\)" <[email protected]>
- Re: [PATCH 02/13] hrtimer: remove useless const
- From: Ingo Molnar <[email protected]>
- Re: [PATCH 02/13] hrtimer: remove useless const
- References:
- [PATCH 02/13] hrtimer: remove useless const
- From: Roman Zippel <[email protected]>
- Re: [PATCH 02/13] hrtimer: remove useless const
- From: Thomas Gleixner <[email protected]>
- Re: [PATCH 02/13] hrtimer: remove useless const
- From: Roman Zippel <[email protected]>
- Re: [PATCH 02/13] hrtimer: remove useless const
- From: Ingo Molnar <[email protected]>
- Re: [PATCH 02/13] hrtimer: remove useless const
- From: Andrew Morton <[email protected]>
- Re: [PATCH 02/13] hrtimer: remove useless const
- From: Roman Zippel <[email protected]>
- Re: [PATCH 02/13] hrtimer: remove useless const
- From: Andrew Morton <[email protected]>
- Re: [PATCH 02/13] hrtimer: remove useless const
- From: Roman Zippel <[email protected]>
- [PATCH 02/13] hrtimer: remove useless const
- Prev by Date: Device enumeration (was Re: CD writing in future Linux (stirring up a hornets' nest))
- Next by Date: Re: Packet writing issue on 2.6.15.1
- Previous by thread: Re: [PATCH 02/13] hrtimer: remove useless const
- Next by thread: Re: [PATCH 02/13] hrtimer: remove useless const
- Index(es):