> -----Original Message-----
> From: Bert Huijben [mailto:bert_at_qqmail.nl]
> Sent: dinsdag 19 november 2013 13:23
> To: 'Julian Foad'; 'Ben Reser'
> Cc: dev_at_subversion.apache.org
> Subject: RE: Warning for missing sentinel arguments
> > -----Original Message-----
> > From: Julian Foad [mailto:julianfoad_at_btopenworld.com]
> > Sent: dinsdag 19 november 2013 12:39
> > To: Ben Reser
> > Cc: dev_at_subversion.apache.org
> > Subject: Re: Warning for missing sentinel arguments
> > > On 11/18/13 3:03 PM, Julian Foad wrote:
> > >> The patch also changes SVN_NO_ERROR from "0" to "((svn_error_t
> > This
> > >> has the side effect of detecting other mis-uses: I committed two such
> > fixes
> > >> as http://svn.apache.org/r1543193 and http://svn.apache.org/r1543216
> . I
> > >> can't think of any negative consequences but shout out if you can.
> > Actually, this is a change of a public API and maybe ABI (I'm not sure), and
> > while it might be a good idea in itself it should not be casually changed as
> > of this patch. So I'll leave out that change and not mark svn_cl__try() with
> > SVN_SENTINEL_NULL, since GCC's attribute requires the sentinel argument
> > to be a pointer.
> It is just compiler magic and doesn't affect the ABI or API. If such a marking
> would affect either of them it would be a breaking change to mark
> something deprecated.
> I'm quite sure the deprecated marking was explicity designed to allow things
> to be marked without breaking it.
> Besides we enable this *only* when we detect a compiler that supports the
> The 0 vs NULL might be a valid argument for this specific function, but I don't
> see how a C compiler could really see the difference in just a simple
> argument list where both must be handed equivalent to the C rules.
> (I don't think the same applies to C++ in general, but luckily we only support
For future reference: I tried to write something about variable argument lists here. (The word 'variable' misses).
Of course there is a difference when using typed variable lists.
It is just that 0 is both a valid pointer and a valid integer in C, and there is no way that the compiler can know what the caller of a function intends to pass in this case. (That is why you get warnings with recent gcc versions that try to validate things for you).
Updating the 'svn' internal api to require a SVN_VA_NULL to terminate the list is probably the best solution. (Thanks Julian!)
Received on 2013-11-19 13:49:43 CET