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

RE: Warning for missing sentinel arguments

From: Bert Huijben <bert_at_qqmail.nl>
Date: Tue, 19 Nov 2013 13:23:10 +0100

> -----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 *)0)".
> 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 part
> 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 annotation.

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 C)

Received on 2013-11-19 13:23:57 CET

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