Hi Ron, I should have been more specific.
We’re using the GNU cross-compiler (for RTEMS) v4.0.2, but we use the
–ansi (and –Wall) flags, which will make a difference.
Also, we’ve got version 1.14 of motor.h. The line containing
#define LSB_First (TRUE) // ...
Is not giving us a problem, probably because cpp is getting at it
before the compiler.
Our errors come from some previous lines in the file (lines 117 and
118) which are:
// Define, from top to bottom, how bit fields are packed.
// This works for VxWorks, SunPro, Linux g++, MS Visual C.
I just added /* ... */ comments.
The typedef problem becomes an issue around line 188, in the following
declaration within motor_dset:
RTN_STATUS (*build_trans) (motor_cmnd, double *, struct motorRecord *);
I changed this by adding ‘enum’:
RTN_STATUS (*build_trans) ( enum motor_cmnd, double *, struct
motorRecord *);
These changes should be okay with any C or C++ compiler, regardless of
ANSI flags.
Thanks!
-doug
On 6/2/06 2:21 PM, "Ronald L. Sluiter" <[email protected]> had this to say:
Hello Doug,
What compiler are you using?
I compiled the latest distribution of the motor record (R5-9) using
five different compilers without a problem.
I presume you mean these C++ comments in motor.h;
"LSB_First (TRUE) // LSB is packed first."
I have changed these to C comments and committed the changes
into CVS. They will appear in the next release.
Could you be more specific as to the "missing typedef" problem?
I don't see that.
Best regards,
Ron
Doug Murray wrote:
Hi Ron, the motor.h include file (we’re using 3.14.8.2) seems to be
written for inclusion in C++ files. Specifically, there are a couple
of ‘//’ comments and a missing typedef for an enum. Can you change
this file to accommodate both C and C++?
-doug
--
Doug Murray
Stanford Linear Accelerator Center
LCLS Controls Department
2575 Sand Hill Road
Menlo Park, CA 94025 MS-102