2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 <2021> 2022 2023 2024 2025 | Index | 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 <2021> 2022 2023 2024 2025 |
<== Date ==> | <== Thread ==> |
---|
Subject: | Re: CaSe-IndepeDent Menu SEARches? |
From: | "Johnson, Andrew N. via Core-talk" <core-talk at aps.anl.gov> |
To: | Ralph Lange <ralph.lange at gmx.de> |
Cc: | EPICS Core Talk <core-talk at aps.anl.gov> |
Date: | Thu, 4 Feb 2021 18:03:10 +0000 |
On Feb 4, 2021, at 10:58 AM, Ralph Lange via Core-talk <core-talk at aps.anl.gov> wrote:
Not convinced; a web-page wouldn’t know about external record types, device support or locally added scan rates or breakpoint tables, amongst other things. That’s why I think it has to be local functionality. A linter would also need to know which DBD
file to use for each DB file it’s checking. We’d have to put something into the build system to specifically request running dbLint against each DB file at build time, and it would have to ignore unexpanded macros in the file so there will still be errors
that only the IOC would see.
And of course a dbLint program would be of lesser use to sites like PSI or ESS that don’t generate an IOC-specific DBD file anyway, only their IOCs know the complete collection of DBD fragments that are being loaded there. A linter could be taught to ignore
unknown record types (or even to ignore just the fields in one that are not found in dbCommon) but the DTYP, SCAN and LINR fields would still generate false positives.
In general I agree with you on that, although some users and sites like ESS & PSI might appreciate a “verbose errors” flag in the IOC.
<technical details>
The existing error message is output by dbRecordField() in dbLexRoutines.c which only knows the error status value, and displays the related text from the header file that defines that status. How it gets the status S_stdlib_extraneous
instead of S_db_badChoice is somewhat confusing though:
dbRecordField() calls
dbPutString() which calls dbPutStringNum() [both in dbStaticRun.c] and that first uses dbGetMenuIndexFromString() [from dbStaticLib.c] to compare the choice strings, then if that
fails it tries epicsParseUInt16() to see if it’s numeric instead. That’s where the
S_stdlib_extraneous status comes from – I was expecting it to be
S_db_badChoice since both dbConvert.c and dbFastLinkConvert.c return that. Thus we have 3 places where we look up a choice string in a menu definition: dbStaticLib.c, dbFastLinkConv.c and dbConvert.c, although the last one
is probably never used in practice since it would only be called for an array of DBF_MENU fields.
</technical details>
- Andrew
--
Complexity comes for free, simplicity you have to work for.
|