** Changed in: epics-base
Status: New => Confirmed
** Changed in: epics-base
Importance: Undecided => Low
** Changed in: epics-base
Assignee: (unassigned) => mdavidsaver (mdavidsaver)
--
You received this bug notification because you are a member of EPICS
Core Developers, which is subscribed to EPICS Base.
Matching subscriptions: epics-core-list-subscription
https://bugs.launchpad.net/bugs/1941875
Title:
Buggy warning message "Record/Alias name '...' should not contain non-
printable ...
Status in EPICS Base:
Confirmed
Bug description:
There are multiple bugs in dbRecordNameValidate()
(modules/database/src/ioc/dbStatic/dbLexRoutines.c).
/* any character restrictions */
char c = *pos;
[...]
if(c < ' ') {
errlogPrintf("Warning: Record/Alias name '%s' should not contain non-printable 0x%02u\n",
name, (unsigned)c);
}
1. The check for non-printable characters: if(c < ' ') does not consider implementations where char is signed. Characters with the high bit set are considered negative and thus <' '.
2. Printing the character with "0x%02u" prints a decimal number prefixed with 0x which is confusing (not to say wrong).
3. Casting a signed char to unsigned effectively first sign extends the char to int, then re-interprets it as unsigned int, turning a char >0x80 into a number >4294967168.
On an implementation where char is unsigned, the whole casting is pointless anyway.
This results in confusing warnings like:
Warning: Record/Alias name 'Ä' should not contain non-printable 0x4294967235
The function should explicitly use unsigned char c to fix (c < ' '),
use "0x%02x" to format c and not cast c.
To manage notifications about this bug go to:
https://bugs.launchpad.net/epics-base/+bug/1941875/+subscriptions
- References:
- [Bug 1941875] [NEW] Buggy warning message "Record/Alias name '...' should not contain non-printable ... Dirk Zimoch via Core-talk
- Navigate by Date:
- Prev:
[Bug 1941875] Re: Buggy warning message "Record/Alias name '...' should not contain non-printable ... mdavidsaver via Core-talk
- Next:
[Bug 1935037] Re: Invalid charactor in field name mdavidsaver via Core-talk
- Index:
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
<2021>
2022
2023
2024
- Navigate by Thread:
- Prev:
[Bug 1941875] Re: Buggy warning message "Record/Alias name '...' should not contain non-printable ... mdavidsaver via Core-talk
- Next:
[Bug 1941875] Re: Buggy warning message "Record/Alias name '...' should not contain non-printable ... mdavidsaver via Core-talk
- Index:
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
<2021>
2022
2023
2024
|