[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: CVS update: subversion/subversion/libsvn_subr svn_string.c

From: Greg Hudson <ghudson_at_MIT.EDU>
Date: 2000-10-14 03:44:38 CEST

> O.K., maybe you can't avoid the cast in this case -- although you
> could argue that the pointer should've been (unsigned char*) in the
> first place.

String literals are char *, and so is the data passed in via a
svn_write_fn_t.

ANSI C guarantees a fair amount about the equivalence of pointers to
signed and unsigned chars, as I recall, so what I do is legal if
perhaps a bit uglier than it would be in a perfect language.

> That's so -- foo* -> void* is implicit, void* -> foo* requires a
> cast in C++, though not in C. But we decided some time ago that we
> don't want to do this (see the archives -- I opened that discussion,
> asking about `__' in identifiers;

Well, there's a difference between something which will definitely
cause a problem in C++ and something that might cause a problem if
we're really unlucky. At any rate, I assume the project will probably
remain agnostic on the issue of casting from void* to foo*.
Received on Sat Oct 21 14:36:11 2006

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.