Code review comment for lp:~epics-core/epics-base/link-support-2

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

>> Should these three be equivalent initializations of INP w/ a long string?
>> longstr2 seems to truncate.

If you create a const link with an array of strings the elements do currently get truncated, the assumption being that you're initializing a waveform with an array of DBF_STRINGs, which are stored as a series of 40 character buffers for something like this:

record(waveform, "longstr4") {
  field(FTVL, "STRING")
  field(NELM, 100)
  field(INP, ["!----------------------------------------------!", "2..."])
}
record(waveform, "longstr5") {
  field(FTVL, "STRING")
  field(NELM, 100)
  field(INP, {const: ["!----------------------------------------------!", "2..."]})
}

Looking at lnkConst_loadArray() though I guess there's no reason to truncate the individual elements when storing them in lnkConst_string(), the truncation will happen when they get copied into the waveform anyway, and doing this lets your 3 initializations be equivalent. Commit that fix?

« Back to merge proposal