[mapserver-dev] build warnings

Frank Warmerdam warmerdam at pobox.com
Thu Oct 23 10:31:01 EDT 2008


Kralidis,Tom [Burlington] wrote:
> Hi: I just upgraded my dev box to fc9, and when make clean &&
> ./configure... && make I am introduced to a number of warnings like:
> 
> mapwms.c:49: warning: 'cvsid_aw' defined but not used
> maporaclespatial.c:42: warning: 'cvsid_aw' defined but not used
> mapgml.c:34: warning: 'cvsid_aw' defined but not used
> mapthread.c:140: warning: 'cvsid_aw' defined but not used
> mapdraw.c:35: warning: 'cvsid_aw' defined but not used
> 
> FYI I never had these errors prior to upgrading to fc9.

Tom,

In mapserver.h we define this macro:

#  define MS_CVSID(string)     static char ms_cvsid[] = string; \
static char *cvsid_aw(void) { return( cvsid_aw() ? ((char *) NULL) : ms_cvsid ); }

In the code we do:

MS_CVSID("$Id: mapdraw.c 7954 2008-10-04 10:59:35Z tbonfort $")

The purpose is to embed SVN revision information as static strings in the
final object code and executable.  The magic with defining the cvsid_aw()
function is intended to avoid unused variable warnings, and it calls
itself to avoid unused function warnings.  It appears that compilers are
getting too smart for us, and they now realize this is unused stuff.

I can't think of a convenient way of avoiding these warnings and still
embed the version information.  But if someone has an approach it only
needs to be altered in mapserver.h.

You can add -DDISABLE_CVSID to your build to disable inclusion of this
stuff which would also presumably avoid the warnings.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent



More information about the mapserver-dev mailing list