Comment 5 for bug 541119

Revision history for this message
Andrew Johnson (anj) wrote :

The startup script could set a variable to suppress the error messages from macLib and just print a warning. Unexpanded macros could still trigger syntax errors in the parser, but the IOC would continue to load if they don't (actually the code already does that, it just prints some scary error messages too). The changes for this are attached.

epics> dbLoadRecords printf-test.db user=anj
macLib: macro bad is undefined (expanding string # $(bad) $(macros)
)
macLib: macro macros is undefined (expanding string # $(bad) $(macros)
)
Warning: 'printf-test.db' line 10 has undefined macros
macLib: macro more is undefined (expanding string # $(more) $(bad) $(macros)
)
macLib: macro bad is undefined (expanding string # $(more) $(bad) $(macros)
)
macLib: macro macros is undefined (expanding string # $(more) $(bad) $(macros)
)
Warning: 'printf-test.db' line 27 has undefined macros
epics> var dbSuppressMacroWarnings 1
epics> dbLoadRecords printf-test.db user=anj
Warning: 'printf-test.db' line 10 has undefined macros
Warning: 'printf-test.db' line 27 has undefined macros
epics>

This code prints a warning for each line in the file that has unexpanded macros. Making that once per file might be possible, but I'll leave someone else to work on that if desired.