Giacomo Catenazzi wrote:I'd say this implies the exact opposite. It almost sounds like the compiler is free to change: void foo(const int *x); foo(x); printf("%d", x); to: void foo(const int *x); printf("%d", x); foo(x); especially if it can prove that the pointer to x doesn't otherwise escape or that foo doesn't call anything that could see the pointer (and given that gcc has special magical markings for malloc, one way this could be "proven" is to have x be some freshly malloced object. If foo is kfree, then the above transformation is clearly invalid. (Note that this isn't just a problem for optimizers -- a programmer might expect that passing a pointer to a function that takes a const pointer argument does not, in and of itself, change the pointed-to value. Given that const certainly does not mean that no one else changes the object, I'm not sure what else it could mean. kfree does not have either property, so I'm don't think it makes sense for it to take a const argument.) --Andy --
| Amit K. Arora | [RFC] Heads up on sys_fallocate() |
| James Bottomley | Re: Integration of SCST in the mainstream Linux kernel |
| Stephen Rothwell | Re: Announce: Linux-next (Or Andrew's dream :-)) |
| Greg KH | [GIT PATCH] driver core patches against 2.6.24 |
git: | |
| Gerrit Renker | [PATCH 27/37] dccp: Integration of dynamic feature activation - part 2 (server side) |
| Jarek Poplawski | [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| Patrick McHardy | Re: [GIT]: Networking |
| Natalie Protasevich | [BUG] New Kernel Bugs |
