On Thu, Jan 17, 2008 at 01:25:39PM -0800, Linus Torvalds wrote: ...That's not how this works (as we obviously agree). Please consider a rewrite of your example, demonstrating the usefulness and proper application of const pointers: extern foo(const int *); int main(int argc, char **argv) { int i; i = 5; foo(&i); return i; } Now, if the program returns anything else than 5, it means someone cast away const, which is generally considered a bad idea in most other software projects, for this very reason. *That* is the purpose of const pointers. Besides, for most debugging-enabled free() implementations, free() does indeed touch the memory pointed to by its argument, which makes giving it a const pointer completely bogus except for a single potential optimized special-case where it might actually not touch the memory. -- / jakob --
| Greg Kroah-Hartman | [PATCH 004/196] Chinese: add translation of SubmittingPatches |
| David Chinner | Re: [RFD] BIO_RW_BARRIER - what it means for devices, filesystems, and dm/md. |
| Andrew Morton | -mm merge plans for 2.6.23 |
| Trent Piepho | Re: [PATCH] [POWERPC] Improve (in|out)_beXX() asm code |
git: | |
| David Miller | Re: iptables very slow after commit784544739a25c30637397ace5489eeb6e15d7d49 |
| Jarek Poplawski | [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| Gerrit Renker | [PATCH 27/37] dccp: Integration of dynamic feature activation - part 2 (server side) |
| David Miller | [GIT]: Networking |
