Closed waynelewis closed 5 years ago
I too cannot check this since it is for use with Dual Port Ram geobricks and we do't use these at Diamond. I don't know who does!
However I'm not sure this fix will work.
The issue is with the line: pRec->val = (short) (0x0000ffff & pDpvt->dpramData.ramLong); pRec is of type eventRecord, defined in EventRecord.h from epics base. The field val is of type epicsUInt16, which translates to ushort on my architecture.
I can't understand why val appears to be a char[40] (epics string?) for you.
Here, the code change does compile with warning:- ../devPmacRam.c: In function ‘devPmacRamEvent_read’: ../devPmacRam.c:1065:3: warning: passing argument 1 of ‘sprintf’ makes pointer from integer without a cast [enabled by default] sprintf(pRec->val, "%ld", (short) (0x0000ffff & pDpvt->dpramData.ramLong)); ^ If I were able to run this I would be trying to treat a ushort as a buiffer pointer and that would break things.
Please can you investigate why you see pRec->val as char[40] ??
Thanks, giles.
Thanks Giles. I'll follow this up and let you know what I find.
The fact that .VAL for the Event record is showing up as char[40] for me is what's causing the problem in the first place.
The VAL field for the Event record changed from epicsUInt16 to char[40] in 3.15. I've been building against 3.15 and 7.0, hence this issue.
I'll close this pull request, and try to work out a way around this issue, and then raise a separate pull request.
The problem was not related to the version of gcc. It is related to the version of EPICS base being used. The code builds correctly on EPICS Base 3.14.x, but not on 3.15.x +.
This now compiles correctly. I have no way of testing the runtime behaviour as I do not have an Ethernet PMAC to test against.
Fixes #70