EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  <20182019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  <20182019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: EPICS database macro warning
From: Ralph Lange <[email protected]>
To: EPICS Tech-Talk <[email protected]>
Date: Wed, 31 Jan 2018 14:36:52 +0100
A bit of background:

The macro expansion library is completely generic, i.e. it does string replacement, that's it. It is independent from any lexer or parser and unaware of the context it is being used in.

The database file parser calls the macro expansion at the beginning of the chain, before doing the parsing.

Calling the macro expansion from inside of the parser, after determining the context (because e.g. a hash mark inside a string value does not start a comment), would require major changes, which IMHO bears too much risk compared to the minor gain of suppressing an unwanted warning. A warning that is technically correct, as you do have an undefined macro at this point.

To not lose the information in the commented line, I would suggest quoting the dollar sign (\$) which will remove its special meaning and silence the macro expansion engine.

Cheers,
~Ralph



On Wed, Jan 31, 2018 at 1:44 PM, Martin L. Smith <[email protected]> wrote:
I know that I have seen this before in EPICS 3.14.12.5 but I simply
removed the commented line.

Marty


On 01/31/2018 06:26 AM, Mark Rivers wrote:
You didn't say what version of EPICS base you are using.


________________________________
From: [email protected] <[email protected]> on behalf of Amien Crombie <[email protected]>
Sent: Wednesday, January 31, 2018 3:28 AM
To: EPICS Tech-Talk
Subject: EPICS database macro warning


Hi

I inadvertently stumbled upon this strange 'bug' in my ioc.db file

I had the following record:

     record(subArray,    "$(uid):attenuator")
     {
             field(INP,        "$(uid):raw")
             field(NELM,        "9")
             field(MALM,        "9")
             field(INDX,        "9")
             field(FTVL,        "LONG")
          #   field(FLNK,        "$(dd):getX")

      }

Now the field 'FLNK' is commented out and I have deleted my macro $(dd) in my substitution file.

When I run my IOC, I get the following warning

macLib: macro dd is undefined (expanding string #    field(FLNK, "$(dd)")

Warning: 'db/dbExample1.db' line 16 has undefined macros


So the comment (#) still evaluates the macro, even if the documentation says it ignores the whole line. Of course if the macro exist it runs without the warning.

Not a critical issue but can be misleading.

Thanks

Amien




References:
EPICS database macro warning Amien Crombie
Re: EPICS database macro warning Mark Rivers
Re: EPICS database macro warning Martin L. Smith

Navigate by Date:
Prev: Re: EPICS database macro warning Martin L. Smith
Next: Re: EPICS database macro warning Wang Xiaoqiang
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  <20182019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: EPICS database macro warning Martin L. Smith
Next: Re: EPICS database macro warning Wang Xiaoqiang
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  <20182019  2020  2021  2022  2023  2024 
ANJ, 31 Jan 2018 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·