registerRecordDeviceDriver.pl bug

Bug #1995728 reported by Dirk Zimoch
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
EPICS Base
Status tracked in 7.0
7.0
Fix Committed
Undecided
Andrew Johnson

Bug Description

In EPICS 7, when processing a dbd file with a long function name (> 24 chars), registerRecordDeviceDriver.pl generates buggy output.

With the following file test.dbd:
function(abcdefghijklmnopqrstuvwxyz0123456789)

The command perl registerRecordDeviceDriver.pl test.dbd generates code with a line break in the middle of a variable name:
epicsShareExtern reg_func pvar_func_register_func_abcdefghijklmnopqrstuvwx
    yz0123456789;

I suspect the error is in line 191 caused by the usage of wrap().

I have tested this with perl v5.16.3 and v5.26.3.

Revision history for this message
Dirk Zimoch (dirk.zimoch) wrote (last edit ):

I think I understand the reason for the buggy line break.
The wrap() documentation says: "When words that are longer than $columns are encountered, they are broken up."
But there are spaces where the line could be broken. Why are they not used?
Because the part "epicsShareExtern reg_func " is the $initial_tab and thus not considered for line break. After that, "pvar_func_register_func_abcdefghijklmnopqrstuvwxyz0123456789" has no space, thus it is broken up.

The solution is:
$Text::Wrap::huge = "overflow";

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

I agree with your assessment and solution. Fixed on the 7.0 branch, including test changes, in commit cbd86ada20cedbff5f45fe8decb3b7b7da71ef0f

Thanks!

Changed in epics-base:
assignee: nobody → Andrew Johnson (anj)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.