[BuildTools] Proposal: XXX_SVN_REV change from quoted string to numeric
Lou Hafer
lou at cs.sfu.ca
Thu Sep 2 12:42:59 EDT 2010
Folks,
One of the SCIP developers has run into a problem trying to identify
exactly what version of clp is available. In particular, he needs to be able to
discriminate between revisions of the trunk, because of changes that are not
backward compatible combined with additions of new features.
What he needs is a numeric constant to examine at compile time (as
opposed to a character string). XXX_VERSION is useless in trunk; it's set as
#define XXX_VERSION "trunk"
Even in stable or release, it's problematic because it's a quoted string.
His proposal was to define a new constant
#define XXX_NUMERIC_VERSION 42
My objection, at least at the level of trunk, is that this will require manual
fussing. I countered by suggesting XXX_SVN_REV, which is meaningful for trunk,
stable, and release. But it needs to change from
#define XXX_SVN_REV "42"
to
#define XXX_SVN_REV 42
(note the absence of quotes, so that it expands to a number that can be compared
at compile time). This change requires a bit of fussing in coin.m4 to make sure
that some of the more exotic output from svnversion is boiled down to a single
number, but that's no big thing.
Does anyone see a hazard? If not, I will commit this change to
BuildTools/trunk tomorrow (Sep. 3).
Looking a bit further afield, what about XXX_VERSION? Are people using
it in a way that requires quoting the value? I can see a much larger potential
for problems with removing the quotes here.
Lou
More information about the BuildTools
mailing list