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 -
| Mike Galbraith | Re: regression: CD burning (k3b) went broke |
| Andi Kleen | [PATCH] [3/22] x86_64: Kill temp boot pmds |
| Alan Cox | Re: [PATCH][RFC] 4K stacks default, not a debug thing any more...? |
| Greg Kroah-Hartman | [PATCH 004/196] Chinese: add translation of SubmittingPatches |
git: | |
| David Miller | [GIT]: Networking |
| Jarek Poplawski | [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| Gerrit Renker | [PATCH 05/37] dccp: Cleanup routines for feature negotiation |
| Brandeburg, Jesse | RE: [PATCH] e1000e: test MSI interrupts |
