Closed markpmitchell closed 10 months ago
No, we cannot — because DEBUG is never defined. :-)
Of course, we could define it somewhere, but NDEBUG is the standard macro used to disable assert. And, most of the Yices code base seems to use “#ifndef NDEBUG” to guard other debug code.
Thank you,
-- Mark Mitchell
On Sep 22, 2023, at 10:01 AM, Ahmed @.***> wrote:
@ahmed-irfan commented on this pull request.
In src/mt/yices_locks_posix.c https://github.com/SRI-CSL/yices2/pull/456#discussion_r1334630099:
int32_t create_yices_lock(yices_lock_t* lock){ int32_t retcode; -#ifdef DEBUG
- retcode = pthread_mutexattr_settype(&mta, PTHREAD_MUTEX_ERRORCHECK);
- if(retcode){
- fprintf(stderr, "create_yices_lock failed: pthread_mutexattr_settype returned %d\n", retcode);
- } +#ifndef NDEBUG minor style thing: can we #ifdef DEBUG?
— Reply to this email directly, view it on GitHub https://github.com/SRI-CSL/yices2/pull/456#pullrequestreview-1640348754, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAKVS3GHJ7RRD5IWI3CIV4TX3W77NANCNFSM6AAAAAA5CLVCBM. You are receiving this because you authored the thread.
I understand.
This pull request contains two components (each in its own commit):
With these changes, the test suite passes using --enable-mcsat --enable-thread-safety. Of course, the testsuite doesn't exercise the multi-threaded mode and we have no way to prove that MC-SAT is 100% thread-safe. But, this would seem to be a step forward.