[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: Alan Barrett <apb_at_cequrux.com>
Date: Fri, 25 Oct 2013 08:55:17 +0200

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.

[1] ISO 9899:1999 section 7.17 paragraph 3: "The macros are NULL
which expands to an implementation-defined null pointer constant;
and ..."

[2] ISO 9899:1999 section 6.3.2.3 paragraph 1: "An integer
constant expression with the value 0, or such an expression cast
to type void*, is called a null pointer constant."

--apb (Alan Barrett)
Received on 2013-10-25 08:56:14 CEST

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.