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  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 
<== Date ==> <== Thread ==>

Subject: Two v7.0.3.1 questions
From: Pierrick M Hanlet via Tech-talk <tech-talk@aps.anl.gov>
To: "tech-talk@aps.anl.gov" <tech-talk@aps.anl.gov>
Date: Tue, 5 Nov 2019 16:21:57 +0000
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 Mark Rivers via Tech-talk

Navigate by Date:
Prev: RE: EPICS support for Eurotherm 3508. Li, Ji via Tech-talk
Next: RE: StreamDevice - disable INVALID/CALC alarm for @mismatch O'Hea, James (DLSLtd, RAL, LSCI) 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 
Navigate by Thread:
Prev: Re: Trying to get new R3.15.7 and synapps 6.1 working. Eric Norum via Tech-talk
Next: RE: Two v7.0.3.1 questions Mark Rivers 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 
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 ·