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

Warning for missing sentinel arguments

From: Julian Foad <julianfoad_at_btopenworld.com>
Date: Mon, 18 Nov 2013 23:03:01 +0000

Following r1543145, the attached patch adds __attribute__((sentinel)) to
functions that require a null sentinel argument, to make GCC warn if the
argument is missing. Via a macro so only for GCC >= 4.0. (I don't see an
equivalent attribute for MSC but if there is one we can add it.)

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.

If no objections I'll commit tomorrow.

- Julian

Received on 2013-11-19 00:03:58 CET

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