Re: [PATCH] Trivial warning fix for imap-send.c
- From
- Mark Wooding <mdw@distorted.org.uk>
- Date
- Mar 12, 2006, 18:01 UTC
- Message-ID
- <slrne18of5.fr9.mdw@metalzone.distorted.org.uk>
- In-Reply-To
- <Pine.LNX.4.64.0603120847500.3618@g5.osdl.org>
Linus Torvalds <torvalds@osdl.org> wrote:
> So in modern C, using NULL at the end of a varargs array as a pointer is > perfectly sane, and the extra cast is just ugly and bowing to bad > programming practices and makes no sense to anybody who never saw the > horror that is K&R.
No! You can still get bitten. You're lucky that on common platforms all pointers look the same, but if you find one where `char *' (and hence `void *') isn't the same as `struct foo *' then, under appropriate circumstances you /will/ unless you put the casts in.
Now, maybe we don't care for GIT. That's your (and Junio's) call. My natural approach is to work as closely as I can to the specs (and then throw in hacks for platforms which /still/ don't work), though, which is why I brought the subject up.
-- [mdw]