From 9e3d5d52abbfa5a8cea542858dcc5af678fcbebe Mon Sep 17 00:00:00 2001 From: Michael Davidsaver Date: Mon, 15 Jun 2020 11:04:59 -0700 Subject: [PATCH] iocshRegisterVariable() avoid spurious redefinition warning Compare the contents, not the container. --- modules/libcom/src/iocsh/iocsh.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/libcom/src/iocsh/iocsh.cpp b/modules/libcom/src/iocsh/iocsh.cpp index c1cf6aa60..b626e1530 100644 --- a/modules/libcom/src/iocsh/iocsh.cpp +++ b/modules/libcom/src/iocsh/iocsh.cpp @@ -181,7 +181,7 @@ void epicsStdCall iocshRegisterVariable (const iocshVarDef *piocshVarDef) for (l = NULL, p = iocshVariableHead ; p != NULL ; l = p, p = p->next) { i = strcmp (piocshVarDef->name, p->pVarDef->name); if (i == 0) { - if (p->pVarDef != piocshVarDef) { + if ((p->pVarDef->type != piocshVarDef->type) && (p->pVarDef->pval != piocshVarDef->pval)) { errlogPrintf("Warning: iocshRegisterVariable redefining %s.\n", piocshVarDef->name); p->pVarDef = piocshVarDef;