Skip to Content.
Sympa Menu

freetds - Re: [freetds] $Id and include file

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: christos AT zoulas.com (Christos Zoulas)
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] $Id and include file
  • Date: Tue, 19 Oct 2004 12:33:27 -0400

On Oct 19, 5:35pm, Frediano.Ziglio AT vodafone.com ("ZIGLIO, Frediano, VF-IT")
wrote:
-- Subject: [freetds] $Id and include file

| Some small analisy show that using these lines in include=20
|
| static char rcsid_tds_h[] =3D "$Id$";
| static void *no_unused_tds_h_warn[] =3D { rcsid_tds_h,
| no_unused_tds_h_warn };
|
| cause a replication of this string for every library module. Also this
| code goes on all programs that use tds include. I readed recently a
| Samba coding style and they use size to determine if program can have
| thread problems (just data should be null). After changing line above
| into
|
| static const char rcsid_tds_h[] =3D "$Id$";
| static const void *const no_unused_tds_h_warn[] =3D { rcsid_tds_h,
| no_unused_tds_h_warn };
|
| code get placed in the same place of constants strings.
|
| Just for statistics all $Id strings occupy about 13K of ODBC while all
| ODBC occupy 260k (that is 5%).
|
| Perhaps it would be better to use /* $Id */ in include and add const in
| modules ??

Well, it is nice to have "ident" say what version of each file the
library contains.

For gcc you can:

#define __RCSID(id) \
static const char rcsid[] \
__attribute__((__unused__,__section__(".ident"))) = id

Unfortunately this makes the section still allocatable, but it puts
it in the ident section. A better and less portable solution is to
use:

#define __RCSID(id) \
__asm__(".section .ident\n\t.asciz \"" id "\"\n\t.previous")

which actually puts the string in a non-allocatable section.

It would be nice to change the rcsid strings in freetds to $FreeTDS$,
instead of using $Id$.

christos




Archive powered by MHonArc 2.6.24.

Top of Page