EPICS Controls Argonne National Laboratory

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: Doug Murray <[email protected]>
To: "Ronald L. Sluiter" <[email protected]>
Cc: TechTalk EPICS <[email protected]>
Date: Mon, 05 Jun 2006 10:07:15 -0700
Title: Re: Motor.h file broken for C
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 Ronald L. Sluiter
References:
Re: Motor.h file broken for C Ronald L. Sluiter

Navigate by Date:
Prev: Re: Scaling a waveform record Tim Mooney
Next: Re: Motor.h file broken for C Ronald L. Sluiter
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 Ronald L. Sluiter
Next: Re: Motor.h file broken for C Ronald L. Sluiter
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 
ANJ, 02 Sep 2010 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·