rcs tags

Discussion of all aspects of the game engine, including development of new and existing features.

Moderators: Forum Moderators, Developers

Post Reply
Darth Fool
Retired Developer
Posts: 2633
Joined: March 22nd, 2004, 11:22 pm
Location: An Earl's Roadstead

rcs tags

Post by Darth Fool » June 10th, 2004, 3:59 pm

I would like to propose including the rcs tags[1] in the code, not just in comments. There is a fairly simple way to keep the rcs Id tags not be optimized away by the compiler, for example:

Code: Select all

#define USE(var) static void * use_##var = (void *) &var
static char crcsid[] =
   "$Id: make_vert.c,v 1.4 1998/10/09 18:26:20 mcnabb Exp $";
USE(crcsid);   /* make sure it is not optimized away */
now causes the string with the rcs tag to be kept in the .o files and the binary file.
In linux you can then run the ident command on an executable to extract the rcs tag information associated with that binary. There is no real performance hit and the object files and binary will be negligibly larger as a result.

[1] for those who don't know the rcs tags are updated by cvs when commits are done so that cvs info can be automatically stored in the file itself and updated by cvs.

Dave
Founding Developer
Posts: 7067
Joined: August 17th, 2003, 5:07 am
Location: Seattle
Contact:

Post by Dave » June 11th, 2004, 8:45 pm

I like this idea. Anyone want to implement it?
“At Gambling, the deadly sin is to mistake bad play for bad luck.” -- Ian Fleming

Darth Fool
Retired Developer
Posts: 2633
Joined: March 22nd, 2004, 11:22 pm
Location: An Earl's Roadstead

Post by Darth Fool » June 11th, 2004, 9:30 pm

If you like it I can go ahead and implement it. It will probably come in the form of a header file and perl script to run on the src directory to add the one or two lines that are needed to all the appropriate files. At some point I had actually worked on a (fairly short) bit of code to make a program "version self-aware" so that with a --version command line option it would spit out the cvs versions of every file in it. It worked ok as long as you weren't trying to link against a library and wanted all the info of the versions inside that library... That is probably overkill here.

Post Reply