Experimental Physics and
| |||||||||||||||||
|
On Fri, 10 Oct 2008, Till Straumann wrote: My guess is that a lot of code would break if ever compiled with -DNDEBUG... I agree, thanks for pointing this out. I have grepped through the source tree and identified several places where we *must* fix this (but unfortunately you're too late for this to happen before R3.14.10), and more where a fix is desirable but not necessarily essential (because the code is for test purposes only). These are highly suspect and should be fixed: ca/nciu.cpp: assert ( this->cacCtx.destroyIO ( ca/comQueSend.h: assert ( pComBuf->push ( val ) ); ca/repeater.cpp: assert ( osiSockAttach() ); gdd/smartGDDPointer.h: assert ( ! this->pValue->reference () ); gdd/smartGDDPointer.h: assert ( ! this->pValue->reference () ); gdd/smartGDDPointer.h: assert ( ! this->pValue->reference () ); gdd/smartGDDPointer.h: assert ( ! this->pValue->unreference () ); gdd/smartGDDPointer.h: assert ( ! pNewValue->reference () ); libCom/osi/os/vxWorks/osdThread.c: assert(semTake(epicsThreadOnceMutex,WAIT_FOREVER)==OK); libCom/osi/os/vxWorks/osdThread.c: assert(semTake(epicsThreadOnceMutex,WAIT_FOREVER)==OK); libCom/osi/epicsEvent.h:#define epicsEventMustWait(ID) assert((epicsEventWait ((ID))==epicsEventWaitOK)) libCom/osi/epicsMutex.h:#define epicsMutexMustLock(ID) assert((epicsMutexLock((ID))==epicsMutexLockOK)) The test programs that also do this are: ca/acctst.c libCom/cxxTemplates/test/tsBTreeBench.cc libCom/cxxTemplates/test/resourceLibTest.cc libCom/cxxTemplates/test/tsBTreeTest.cc These should be modified to use the epicsUnitTest framework instead of assert. Unless someone finds a serious problem in the R3.14.10-RC2 release we won't have the opportunity to fix these before the final R3.14.10 release (I don't regard these as serious enough by themselves to stop the release since as long as you don't define NDEBUG there is no problem with the existing code), but we definitely want to get rid of these incorrect usages of assert(). - Andrew
| ||||||||||||||||
ANJ, 02 Sep 2010 |
·
Home
·
News
·
About
·
Base
·
Modules
·
Extensions
·
Distributions
·
Download
·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing · |