Re: [PATCH] Fix git to be (more) ANSI C99 compliant.

From: Florian Forster <octo@verplant.org>
Date: 2006-06-20 07:21:16
On Sun, Jun 18, 2006 at 09:50:37AM -0700, Linus Torvalds wrote:
> > While most of this patch fixes void-pointer arithmetic
> 
> This one I disagree with. Doing arithmetic on "void *" is _really_ useful, 

Agreed: If you want to walk over the memory pointed to by a void-pointer
you want to do that byte-wise in the great majority of all cases.

> and I think most compilers end up supporting it either to be
> compatible with gcc, or just because it's hard to not do it.

Now this statement I don't agree with. (And by that I don't mean I
assume it to be false.)

I didn't start writing the patch because I like C99 so much. In fact, in
my opinion it introduces some possibilities I'd rather not have in C
because people might actually use them. But by default the Sun cc
complains about void-pointer arithmetic and I feel awkward to force the
compiler to accept broken code.

Maybe Rene Scharfe's method (as used in the patch to git-tar-tree) is a
good way around it? There are no explicit casts involved and standard-
compliant compilers like it, too. The downside is that you have two
variables for the same thing/memory.

Regards,
-octo
-- 
Florian octo Forster
Hacker in training
GnuPG: 0x91523C3D
http://verplant.org/

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Received on Tue Jun 20 07:21:51 2006

This archive was generated by hypermail 2.1.8 : 2006-06-20 07:22:14 EST