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

Re: svn commit: r1535399 - in /subversion/trunk/subversion: libsvn_fs_fs/ libsvn_fs_x/ libsvn_subr/ libsvn_wc/ mod_authz_svn/ tests/cmdline/ tests/libsvn_client/ tests/libsvn_fs_fs/ tests/libsvn_fs_x/ tests/libsvn_subr/ tests/libsvn_wc/

From: Philip Martin <philip.martin_at_wandisco.com>
Date: Fri, 25 Oct 2013 10:28:22 +0100

Alan Barrett <apb_at_cequrux.com> writes:

> On Fri, 25 Oct 2013, Branko Čibej wrote:
>>> URL: http://svn.apache.org/r1535399
>>> Log:
>>> Cast NULL to (char *) in vararg calls to svn_dirent_join_many
>>> and svn_path_join_many.
>>
>>
>>Why? On which platform do you expect a char* to have a different size
>>and/or representation than a void*?
>
> NULL may be defined as any null pointer constant [1]; acceptable values include 0 or ((void *)0) [2]. If NULL is defined as 0, then passing it to a varargs function that expects any kind of pointer will not work properly.

We have had this discussion in the past and decided that casting was
strictly correct; in some places we were already using (char *)NULL:

http://svn.haxx.se/dev/archive-2011-02/0841.shtml

-- 
Philip Martin | Subversion Committer
WANdisco // *Non-Stop Data*
Received on 2013-10-25 11:29:02 CEST

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