EPICS Home

Experimental Physics and Industrial Control System


 
1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  <20062007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  <20062007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: Motor.h file broken for C
From: "Ronald L. Sluiter" <[email protected]>
To: Doug Murray <[email protected]>
Cc: TechTalk EPICS <[email protected]>
Date: Mon, 05 Jun 2006 13:02:20 -0500
Hello Doug,

In that case, we are way ahead... OK, we are a couple of months
ahead of you. Mark Rivers removed the C++ comments and
added a typedef to the motor_cmnd enumeration several months
ago. I released these changes with version R5-9 of the motor
record distribution on 04/25/06; so you should not have to make
these local modifications with R5-9 and above.

Hope this helps,
Ron

Doug Murray wrote:

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







Replies:
Re: Motor.h file broken for C Doug Murray
References:
Re: Motor.h file broken for C Doug Murray

Navigate by Date:
Prev: Re: Motor.h file broken for C Doug Murray
Next: Re: Motor.h file broken for C Doug Murray
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  <20062007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: Motor.h file broken for C Doug Murray
Next: Re: Motor.h file broken for C Doug Murray
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  <20062007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024