Re: [PATCH] Constness fix for pickaxe option.
- From
Linus Torvalds <torvalds@osdl.org>
- Date
- May 21, 2005, 22:16 UTC
- Message-ID
- <Pine.LNX.4.58.0505211514360.2206@ppc970.osdl.org>
- In-Reply-To
- <7v1x80gruc.fsf_-_@assigned-by-dhcp.cox.net>
On Sat, 21 May 2005, Junio C Hamano wrote:
> > Constness fix for pickaxe option.
Btw, this:
static const char *pickaxe = 0;
may be legal C, but that doesn't make it less crap.
It's a pointer. If you want to make it a NULL pointer, make it a NULL pointer:
static const char *pickaxe = NULL;
and don't try to stuff an integer into a pointer. Yeah, yeah, the integer zero is magic and special, but that's a bug in the C language, and we should try to not perpetuate it.
Linus