From 5b84a86ccd7d5db78c7c1d75f7e82ec766f48a2d Mon Sep 17 00:00:00 2001 From: Emilio Perez Date: Wed, 8 Mar 2023 14:48:02 +0000 Subject: [PATCH] Allow adding error symbols after early initialization This was acomplished by making errSymbolAdd add the error symbol directly into the global hash table and removing errnumlist which is not needed anymore. Unit tests were added for checking the following cases: - Adding a valid symbol and checking that it exists (fixed by this change) - Getting an existing error symbol - Getting a non existing error symbol - Adding an invalid error symbol (fixed by this change) - Adding an error symbol with a code that already exists (fixed by this change) Therefore, issue #268 was fixed error: statically allocate error symbol hash table This will allow calling errSymbolAdd before errSymBld, therefore, a function adding error symbols can now be run before iocInit or errlogInit error: add a constant for the minimum module number Make adding an identical error symbol not fail A test case was also added which test that adding an error symbol with same error code and message as one added before will not fail Add locking to error symbol table This protects the cases of: - simultaneously adding and requesting of an error symbol - simultaneously adding many error symbols Update release notes regarding adding error symbols --- modules/libcom/src/error/errSymLib.c | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/libcom/src/error/errSymLib.c b/modules/libcom/src/error/errSymLib.c index ae2267150..a47208062 100644 --- a/modules/libcom/src/error/errSymLib.c +++ b/modules/libcom/src/error/errSymLib.c @@ -23,7 +23,6 @@ #include "cantProceed.h" #include "epicsAssert.h" #include "epicsStdio.h" -#include "epicsTypes.h" #include "epicsMutex.h" #include "epicsThread.h" #include "errMdef.h"