dbLoadXxx expand macros in comment lines
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
EPICS Base |
Won't Fix
|
Medium
|
Andrew Johnson |
Bug Description
From Mark Rivers:
I think there is a bug in the current versions of dbLoadRecords, dbLoadDatabase and dbLoadTemplate. If there is a string that looks like a macro argument in a comment, but the macro is not defined, the parser incorrectly flags an error. The parser should not attempt macro expansion in comments.
Additional information:
Here is a test database, test.db.
#######
# This is a database with a string that looks like a macro parameter
# in a comment. The string is $(P2).
grecord(ao, $(P1))
{
}
#######
Here is what happens with dbLoadRecords:
dbLoadRecords(
filename=
<string>: P2 referenced but undefined
filename=
macExpandString failed for file test.db
Here is what happens with dbLoadDatabase:
dbLoadDatabase(
filename=
<string>: P2 referenced but undefined
filename=
macExpandString failed for file test.db
dbLoadTemplate also gives an error.
Original Mantis Bug: mantis-38
http://
This could be a little tricky to fix, as the macro expansion is currently done before we get into the lex code. Luckily we use the lexer to throw away comments rather than the yacc grammar, so it might be do-able that way. The danger is likely to be that some things which used to work won't any more, e.g. using a macro to provide both a field name and value to a record definition. Alternatively we'd have to move the comment stripping into the input buffer management code, which is not nice.
Any other suggestions?