[MERGE] Re: bzr version-info for C/C++

John Arbash Meinel john at arbash-meinel.com
Tue Oct 9 18:28:57 BST 2007


John Arbash Meinel has voted tweak.
Status is now: Conditionally approved
Comment:
I'm okay with this, though I would like to make a few comments.

a) #define is probably the most common way to do this sort of thing, but 
I personally prefer "const char*" variables. Because you can refer to 
them, and look them up in a debugger, they are always compiled into the 
source, etc. I suppose users can do:

version.c:

#include "autogenerated_version.h"

const char *revision_id = VERSION_INFO_REVISION_ID;

b) We don't have any way to give the version strings any sort of unique 
name/namespace, etc. You don't need it in python, because every file is 
a namespace. *I* would like to see a way to add some way to have 
multiple versions in a large project. Imagine having 3 libraries and a 
main program all independently versioned. You version variables/defines 
step on eachother's toes. I'm not sure how to do it for C code, but we 
could end up with a C++ version that uses the built-in namespace 
functionality.

For details, see: 
http://bundlebuggy.aaronbentley.com/request/%3C5288a560710060512y6cd2b103ucf88fce3ad32a413%40mail.gmail.com%3E



More information about the bazaar mailing list