EPICS Home

Experimental Physics and Industrial Control System


 
2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  <20222023  2024  Index 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  <20222023  2024 
<== Date ==> <== Thread ==>

Subject: Re: breaktable name incompatibilities
From: "Johnson, Andrew N. via Core-talk" <core-talk at aps.anl.gov>
To: Dirk Zimoch <dirk.zimoch at psi.ch>
Cc: EPICS core-talk <core-talk at aps.anl.gov>
Date: Tue, 4 Jan 2022 16:08:13 +0000
Hi Dirk,

On Jan 4, 2022, at 3:09 AM, Zimoch Dirk (PSI) via Core-talk <core-talk at aps.anl.gov> wrote:

But in EPICS 7, registerRecordDeviceDriver.pl complains:
Syntax error in 'breaktable(ZX47-55LN+_142.8MHz) {'

Not very informative, but let's try with quotes. Now the error is:
Illegal breakpoint table name 'ZX47-55LN+_142.8MHz'
       Identifiers are used in C code so must start with a letter, followed
       by letters, digits and/or underscore characters only.

Why that? The name of a breaktable is never used as a C identifier. It is simply a string.

Identifier rules defaulted to that in the new DBD file parser, but I agree they don’t need to be that strict for breakpoint table names. I will insist on the quotes though.


Such breaking changes are very inconvenient, as they require to change all the templates where the name is used and make transition to EPICS 7 unnecessarily cumbersome.

Can we change it back?

Sure, please try applying this patch which makes the expected charset match that of record names, and only warns if it finds other characters in the string:

diff --git a/modules/database/src/tools/DBD/Breaktable.pm b/modules/database/src/tools/DBD/Breaktable.pm
index 54e699131..06dae996c 100644
--- a/modules/database/src/tools/DBD/Breaktable.pm
+++ b/modules/database/src/tools/DBD/Breaktable.pm
@@ -20,6 +20,20 @@ sub init {
     return $this;
 }

 

+# Override, breaktable names are not strict
+sub identifier {
+    my ($this, $id, $what) = @_;
+    confess "DBD::Breaktable::identifier: $what undefined!"
+        unless defined $id;
+    if ($id !~ m/^$RXname$/) {
+        my @message;
+        push @message, "A $what should contain only letters, digits and these",
+            "special characters: _ - : . [ ] < > ;" unless $warned++;
+        warnContext("Deprecated $what '$id'", @message);
+    }
+    return $id;
+}
+
 sub add_point {
     my ($this, $raw, $eng) = @_;
     confess "DBD::Breaktable::add_point: Raw value undefined!"


- Andrew

-- 
Complexity comes for free, simplicity you have to work for.


References:
breaktable name incompatibilities Zimoch Dirk (PSI) via Core-talk

Navigate by Date:
Prev: breaktable name incompatibilities Zimoch Dirk (PSI) via Core-talk
Next: Re: breaktable name incompatibilities Michael Davidsaver via Core-talk
Index: 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  <20222023  2024 
Navigate by Thread:
Prev: breaktable name incompatibilities Zimoch Dirk (PSI) via Core-talk
Next: Re: breaktable name incompatibilities Michael Davidsaver via Core-talk
Index: 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  <20222023  2024