Argonne National Laboratory

Experimental Physics and
Industrial Control System

2002  2003  2004  2005  <20062007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  Index 2002  2003  2004  2005  <20062007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020 
<== Date ==> <== Thread ==>

Subject: Re: Q: revision strings
From: Andrew Johnson <anj@aps.anl.gov>
To: Ralph Lange <Ralph.Lange@bessy.de>
Cc: EPICS core-talk <core-talk@aps.anl.gov>
Date: Thu, 16 Nov 2006 13:39:29 -0600
Ralph Lange wrote:
I know you had an idea for that, but I can't find the mail, so:

Is there a smart way to get revision strings (static const char *id =
"@(#) ...") into C code without producing a compiler warning?

I was using a construct like this:

static const struct sccsid {struct sccsid *p; char *id; } sccsid = {
    &id, "$Id$"
}

But I just discovered online that the right way to do it seems to be this:

static const char sccsid[] = "$Id$";

When using an array instead of a pointer, gcc doesn't warn.

I'm about to commit that * => [] change to src/ca/cac.cpp, src/misc/epicsRelease.c, src/cas/generic/caServerI.cc, src/libCom/osi/devLib.c and src/libCom/osi/epicsTime.cpp to fix the warnings from those files...

- Andrew
--
There is considerable overlap between the intelligence of the smartest
bears and the dumbest tourists -- Yosemite National Park Ranger

Navigate by Date:
Prev: Re: 3.14.9 schedule Andrew Johnson
Next: R3-14-9-pre1 on Monday Andrew Johnson
Index: 2002  2003  2004  2005  <20062007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020 
Navigate by Thread:
Prev: Re: 3.14.9 schedule Andrew Johnson
Next: R3-14-9-pre1 on Monday Andrew Johnson
Index: 2002  2003  2004  2005  <20062007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020 
ANJ, 02 Feb 2012 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·