EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

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

Subject: RE: Two v7.0.3.1 questions
From: Mark Rivers via Tech-talk <[email protected]>
To: 'Pierrick M Hanlet' <[email protected]>
Cc: "[email protected]" <[email protected]>
Date: Tue, 5 Nov 2019 18:20:15 +0000

Hi Pierrick,

 

I have used epicsRegisterFunction from C++ code with no problems on 7.0.3.1.  Look at:

 

https://github.com/areaDetector/ADCore/blob/master/ADApp/ADSrc/myAttributeFunctions.cpp

 

It contains:

 

static int myAttrFunct1(const char *paramString, void **functionPvt, functAttribute *pAttribute) {

}

extern "C" {

epicsRegisterFunction(myAttrFunct1);

}

 

Ø  /home/epics/epicsDEV/base/include/epicsTypes.h:44:14: warning: ISO C++ 1998 does not support 'long long' [-Wlong-long]

Ø  typedef long long       epicsInt64;

 

This suggests that your compiler is being set to use ISO 1998 mode.  Depending on the version of gcc you can set it to another standard by setting USR_CFLAGS += -std=[desired version].  Do the same for USR_CXXFLAGS for C++ code.

 

Look at man gcc to see the available options.

 

Mark

 

 

From: Tech-talk <[email protected]> On Behalf Of Pierrick M Hanlet via Tech-talk
Sent: Tuesday, November 5, 2019 10:22 AM
To: [email protected]
Subject: Two v7.0.3.1 questions

 

Hi,
I'm on a linux SL7.6 machine and am using v7.0.3.1.

I don't understand the epicsRegisterFunction macro.  I've used aSubRecords dozens of times
with C files, but now that I'm attempting to use it in a C++ file, I cannot get the macro to
do its magic.  At the bottom of my xxx.cpp file with all the correct headers, I have the code:
extern "C" {
  short PVdata(struct aSubRecord*);
}
short PVdata(struct aSubRecord *pvData) {
  return 0;               // this will eventually be real code
}
extern "C" {
  epicsRegisterFunction(PVdata);
}

This results in:
/home/epics/epicsDEV/base/include/epicsExport.h:37:22: warning: ISO C++ forbids casting between pointer-to-function and pointer-to-object [-Wpedantic]
 epicsExportRegistrar(register_func_ ## func)
                      ^
/home/epics/epicsDEV/base/include/epicsExport.h:32:72: note: in definition of macro 'epicsExportRegistrar'
 epicsShareFunc REGISTRAR EPICS_EXPORT_PFUNC(func) = (REGISTRAR)(void*)&func
                                                                        ^
../acnetPV.cpp:167:3: note: in expansion of macro 'epicsRegisterFunction'
   epicsRegisterFunction(PVdata);
   ^
/home/epics/epicsDEV/base/include/epicsExport.h:37:22: warning: ISO C++ forbids casting between pointer-to-function and pointer-to-object [-Wpedantic]
 epicsExportRegistrar(register_func_ ## func)
                      ^
/home/epics/epicsDEV/base/include/epicsExport.h:32:72: note: in definition of macro 'epicsExportRegistrar'
 epicsShareFunc REGISTRAR EPICS_EXPORT_PFUNC(func) = (REGISTRAR)(void*)&func
                                                                        ^
../acnetPV.cpp:167:3: note: in expansion of macro 'epicsRegisterFunction'
   epicsRegisterFunction(PVdata);

Am I misusing epicsRegisterFunction() somehow?


As a second issue, I get some weird warning messages:
In file included from /home/epics/epicsDEV/base/include/epicsStdlib.h:20:0,
                 from acnetPV_registerRecordDeviceDriver.cpp:9:
/home/epics/epicsDEV/base/include/epicsTypes.h:44:14: warning: ISO C++ 1998 does not support 'long long' [-Wlong-long]
 typedef long long       epicsInt64;
              ^
/home/epics/epicsDEV/base/include/epicsTypes.h:45:23: warning: ISO C++ 1998 does not support 'long long' [-Wlong-long]
 typedef unsigned long long epicsUInt64;
                       ^
In file included from acnetPV_registerRecordDeviceDriver.cpp:9:0:
/home/epics/epicsDEV/base/include/epicsStdlib.h:39:43: warning: ISO C++ 1998 does not support 'long long' [-Wlong-long]
     epicsParseLLong(const char *str, long long *to, int base, char **units);
                                           ^
/home/epics/epicsDEV/base/include/epicsStdlib.h:41:53: warning: ISO C++ 1998 does not support 'long long' [-Wlong-long]
     epicsParseULLong(const char *str, unsigned long long *to, int base, char **units);
                                                     ^
In file included from /home/epics/epicsDEV/base/include/registryCommon.h:15:0,
                 from acnetPV_registerRecordDeviceDriver.cpp:12:
/home/epics/epicsDEV/base/include/dbJLink.h:69:48: warning: ISO C++ 1998 does not support 'long long' [-Wlong-long]
     jlif_result (*parse_integer)(jlink *, long long num);
                                                ^



   ^



-- 
Pierrick Hanlet
Fermi National Accelerator
Accelerator Front End Controls
+1-630-840-5555 -- lab
+1-312-687-4980 -- mobile
 
"Whether you think you can or think you can't, you're right" -- Henry Ford

Replies:
Re: Two v7.0.3.1 questions Pierrick M Hanlet via Tech-talk
References:
Two v7.0.3.1 questions Pierrick M Hanlet via Tech-talk

Navigate by Date:
Prev: RE: StreamDevice - disable INVALID/CALC alarm for @mismatch O'Hea, James (DLSLtd, RAL, LSCI) via Tech-talk
Next: Re: Two v7.0.3.1 questions Pierrick M Hanlet via Tech-talk
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  <20192020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Two v7.0.3.1 questions Pierrick M Hanlet via Tech-talk
Next: Re: Two v7.0.3.1 questions Pierrick M Hanlet via Tech-talk
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  <20192020  2021  2022  2023  2024 
ANJ, 05 Nov 2019 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·