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 --
| Tarkan Erimer | Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3 |
| Greg KH | [GIT PATCH] driver core patches against 2.6.24 |
| David Miller | Slow DOWN, please!!! |
| Peter Zijlstra | [PATCH 00/23] per device dirty throttling -v8 |
| 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(). |
| David Miller | [GIT]: Networking |
| Natalie Protasevich | [BUG] New Kernel Bugs |
git: | |
