From 8d318d9a99c81c584e17da9b08edf7bd0cd83db5 Mon Sep 17 00:00:00 2001 From: Jeff Hill Date: Thu, 19 Dec 2002 01:29:57 +0000 Subject: [PATCH] suppress gnu warning --- src/ca/cac.cpp | 10 ++++++++-- src/cas/generic/caServerI.cc | 9 ++++++--- src/libCom/osi/epicsTime.cpp | 21 +++++++++++++++------ 3 files changed, 29 insertions(+), 11 deletions(-) diff --git a/src/ca/cac.cpp b/src/ca/cac.cpp index c0a2802c6..927aa4018 100644 --- a/src/ca/cac.cpp +++ b/src/ca/cac.cpp @@ -44,7 +44,9 @@ #include "net_convert.h" #include "autoPtrDestroy.h" -static const char *id = "@(#) " EPICS_VERSION_STRING ", CA Portable Server Library" __DATE__; +static const char *pVersionCAC = + "@(#) " EPICS_VERSION_STRING + ", CA Portable Server Library " __DATE__; // TCP response dispatch table const cac::pProtoStubTCP cac::tcpJumpTableCAC [] = @@ -336,6 +338,10 @@ void cac::show ( unsigned level ) const ::printf ( "Channel Access Client Context at %p for user %s\n", static_cast ( this ), this->pUserName ); + // this also supresses the "defined, but not used" + // warning message + ::printf ( "\trevision \"%s\"\n", pVersionCAC ); + if ( level > 0u ) { this->serverTable.show ( level - 1u ); ::printf ( "\tconnection time out watchdog period %f\n", this->connTMO ); @@ -370,7 +376,7 @@ void cac::show ( unsigned level ) const ::printf ( "Default mutex:\n"); this->mutex.show ( level - 4u ); ::printf ( "mutex:\n" ); - this->mutex.show ( level - 3u ); + this->mutex.show ( level - 4u ); } } diff --git a/src/cas/generic/caServerI.cc b/src/cas/generic/caServerI.cc index 92094af11..3274d6f78 100644 --- a/src/cas/generic/caServerI.cc +++ b/src/cas/generic/caServerI.cc @@ -28,7 +28,9 @@ #include "beaconTimer.h" #include "beaconAnomalyGovernor.h" -static const char *id = "@(#) " EPICS_VERSION_STRING ", CA Portable Server Library" "$Date$"; +static const char * pVersionCAS = + "@(#) " EPICS_VERSION_STRING ", CA Portable Server Library " + "$Date$"; // // caServerI::caServerI() @@ -184,9 +186,10 @@ void caServerI::show (unsigned level) const { int bytes_reserved; - printf( "Channel Access Server Status V%s\n", + printf ( "Channel Access Server V%s\n", CA_VERSION_STRING ( CA_MINOR_PROTOCOL_REVISION ) ); - + printf ( "\trevision %s\n", pVersionCAS ); + this->mutex.show(level); { diff --git a/src/libCom/osi/epicsTime.cpp b/src/libCom/osi/epicsTime.cpp index 0a2868700..77f13644c 100644 --- a/src/libCom/osi/epicsTime.cpp +++ b/src/libCom/osi/epicsTime.cpp @@ -24,7 +24,8 @@ #include "epicsTime.h" #include "osiSock.h" /* pull in struct timeval */ -static const char *id = "@(#) " EPICS_VERSION_STRING ", Common Utilities Library" __DATE__; +static const char *pEpicsTimeVersion = + "@(#) " EPICS_VERSION_STRING ", Common Utilities Library " __DATE__; // // useful public constants @@ -507,15 +508,23 @@ size_t epicsTime::strftime ( char *pBuff, size_t bufLength, const char *pFormat // // epicsTime::show (unsigned) // -void epicsTime::show (unsigned) const +void epicsTime::show ( unsigned level ) const { char bigBuffer[256]; - size_t numChar = strftime (bigBuffer, sizeof(bigBuffer), - "%a %b %d %Y %H:%M:%S.%09f"); - if (numChar>0) { - printf ("epicsTime: %s\n", bigBuffer); + size_t numChar = strftime ( bigBuffer, sizeof ( bigBuffer ), + "%a %b %d %Y %H:%M:%S.%09f" ); + if ( numChar > 0 ) { + printf ( "epicsTime: %s\n", bigBuffer ); } + + if ( level > 1 ) { + // this also supresses the "defined, but not used" + // warning message + printf ( "epicsTime: revision \"%s\"\n", + pEpicsTimeVersion ); + } + } //