On Sun, Sep 23, 2007 at 10:05:05AM -0700, Linus Torvalds wrote:I don't like it when macros magically do sizeof(*p), because people often think that the macro is smarter than it really is, and you commonly end up with code looking like this : char *p; ... p = kmalloc(n); ... memclear(p); This can happen for instance when replacing a stack-allocated buffer with a malloc because it became too big for the stack. Such a mistake is *very hard* to detect by human eye, while having "sizeof(*p)" in the same function as "char *p" will trigger some automatisms in most readers' brains. At least current code is still greppable for such usages. Doing too much magics with macros often harms debugging. I could agree with having a macro to force the pattern to '0', but not to force the size. I don't think either. Willy -
| Heiko Carstens | Re: -mm merge plans for 2.6.23 -- sys_fallocate |
| david | Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3 |
| Greg KH | [GIT PATCH] driver core patches against 2.6.24 |
| Bart Van Assche | Re: Integration of SCST in the mainstream Linux kernel |
git: | |
| Gerrit Renker | [PATCH 27/37] dccp: Integration of dynamic feature activation - part 2 (server side) |
| David Miller | [GIT]: Networking |
| Badalian Vyacheslav | e1000: Question about polling |
| David Miller | Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
