epics-extensions / ca-gateway

Channel Access PV Gateway
http://www.aps.anl.gov/epics/extensions/gateway/
Other
17 stars 17 forks source link

Fix build error for gcc 4.8.5 and VALUE_to_string() default param. #42

Closed bhill-slac closed 2 years ago

bhill-slac commented 2 years ago

Needed for builds on rhel7.

ralphlange commented 2 years ago

Using

gcc version 4.8.5 20150623 (Red Hat 4.8.5-16) (GCC)

I am not getting any build errors without this change.

What are you referring to?

bhill-slac commented 2 years ago

Here's the build error I see w/o this fix:

bhill-slac commented 2 years ago

/usr/bin/make -C ./configure install make[1]: Entering directory /reg/g/pcds/epics-dev/bhill/extensions/ca-gateway-git/configure' /usr/bin/make -C O.rhel7-x86_64 -f ../Makefile TOP=../.. \ T_A=rhel7-x86_64 install make[2]: Entering directory/reg/g/pcds/epics-dev/bhill/extensions/ca-gateway-git/configure/O.rhel7-x86_64' perl -CSD /reg/g/pcds/epics/base/R7.0.2-2.0/bin/rhel7-x86_64/convertRelease.pl checkRelease make[2]: Leaving directory /reg/g/pcds/epics-dev/bhill/extensions/ca-gateway-git/configure/O.rhel7-x86_64' make[1]: Leaving directory/reg/g/pcds/epics-dev/bhill/extensions/ca-gateway-git/configure' /usr/bin/make -C ./src install make[1]: Entering directory /reg/g/pcds/epics-dev/bhill/extensions/ca-gateway-git/src' /usr/bin/make -C O.rhel7-x86_64 -f ../Makefile TOP=../.. \ T_A=rhel7-x86_64 install make[2]: Entering directory/reg/g/pcds/epics-dev/bhill/extensions/ca-gateway-git/src/O.rhel7-x86_64' /usr/bin/g++ -D_GNU_SOURCE -D_DEFAULT_SOURCE -D_X8664 -DUNIX -Dlinux -O3 -g -pipe -Wall -DSTAT_PVS -DRATE_STATS -DCONTROL_PVS -DCAS_DIAGNOSTICS -DHANDLE_EXCEPTIONS -DUSE_DENYFROM -DWITH_CAPUTLOG -m64 -I. -I../O.Common -I. -I. -I.. -I../../include/compiler/gcc -I../../include/os/Linux -I../../include -I/afs/slac/g/lcls/tools/include -I/reg/g/pcds/epics/R7.0.2-2.0/modules/caPutLog/R3.7-1.0.0/include -I/reg/g/pcds/epics/R7.0.2-2.0/modules/pcas/R4.13.2-0.3.0/include -I/reg/g/pcds/epics/base/R7.0.2-2.0/include/compiler/gcc -I/reg/g/pcds/epics/base/R7.0.2-2.0/include/os/Linux -I/reg/g/pcds/epics/base/R7.0.2-2.0/include -I/reg/g/pcds/epics/base/R7.0.2-2.0/src/cas/generic -I/reg/g/pcds/epics/base/R7.0.2-2.0/src/ca/legacy/pcas/generic -MM -MF gateResources.d ../gateResources.cc make[2]: Leaving directory /reg/g/pcds/epics-dev/bhill/extensions/ca-gateway-git/src/O.rhel7-x86_64' make[2]: Entering directory/reg/g/pcds/epics-dev/bhill/extensions/ca-gateway-git/src/O.rhel7-x86_64' /usr/bin/g++ -D_GNU_SOURCE -D_DEFAULT_SOURCE -D_X8664 -DUNIX -Dlinux -O3 -g -pipe -Wall -DSTAT_PVS -DRATE_STATS -DCONTROL_PVS -DCAS_DIAGNOSTICS -DHANDLE_EXCEPTIONS -DUSE_DENYFROM -DWITH_CAPUTLOG -m64 -I. -I../O.Common -I. -I. -I.. -I../../include/compiler/gcc -I../../include/os/Linux -I../../include -I/afs/slac/g/lcls/tools/include -I/reg/g/pcds/epics/R7.0.2-2.0/modules/caPutLog/R3.7-1.0.0/include -I/reg/g/pcds/epics/R7.0.2-2.0/modules/pcas/R4.13.2-0.3.0/include -I/reg/g/pcds/epics/base/R7.0.2-2.0/include/compiler/gcc -I/reg/g/pcds/epics/base/R7.0.2-2.0/include/os/Linux -I/reg/g/pcds/epics/base/R7.0.2-2.0/include -I/reg/g/pcds/epics/base/R7.0.2-2.0/src/cas/generic -I/reg/g/pcds/epics/base/R7.0.2-2.0/src/ca/legacy/pcas/generic -c ../gateResources.cc ../gateResources.cc: In member function 'void gateResources::putLog(FILE, const char, const char, const char, const gdd, const gdd)': ../gateResources.cc:414:89: error: call of overloaded 'VALUE_to_string(char [20], int, VALUE, int)' is ambiguous VALUE_to_string( acOldVal, 20, &oldVal, gddGetOurType(old_value) ); ^ ../gateResources.cc:414:89: note: candidates are: In file included from ../gateResources.cc:49:0: /reg/g/pcds/epics/R7.0.2-2.0/modules/caPutLog/R3.7-1.0.0/include/caPutLogTask.h:47:20: note: int VALUE_to_string(char, size_t, const VALUE, short int) epicsShareFunc int VALUE_to_string(char pbuf, size_t buflen, const VALUE pval, short type); ^ ../gateResources.cc:196:12: note: int VALUE_to_string(char, size_t, const VALUE, short int, bool) static int VALUE_to_string(char pbuf, size_t buflen, const VALUE pval, short dbfld_dbrtype, bool prefix_with_type = false) ^ ../gateResources.cc:417:81: error: call of overloaded 'VALUE_to_string(char [20], int, VALUE, int)' is ambiguous VALUE_to_string( acNewVal, 20, &newVal, gddGetOurType(new_value) ); ^ ../gateResources.cc:417:81: note: candidates are: In file included from ../gateResources.cc:49:0: /reg/g/pcds/epics/R7.0.2-2.0/modules/caPutLog/R3.7-1.0.0/include/caPutLogTask.h:47:20: note: int VALUE_to_string(char, size_t, const VALUE, short int) epicsShareFunc int VALUE_to_string(char pbuf, size_t buflen, const VALUE pval, short type); ^ ../gateResources.cc:196:12: note: int VALUE_to_string(char, size_t, const VALUE, short int, bool) static int VALUE_to_string(char pbuf, size_t buflen, const VALUE pval, short dbfld_dbrtype, bool prefix_with_type = false) ^ ../gateResources.cc: At global scope: ../gateResources.cc:196:12: warning: 'int VALUE_to_string(char, size_t, const VALUE, short int, bool)' defined but not used [-Wunused-function] make[2]: [gateResources.o] Error 1 make[2]: Leaving directory `/reg/g/pcds/epics-dev/bhill/extensions/ca-gateway-git/src/O.rhel7-x86_64' make[1]: [install.rhel7-x86_64] Error 2 make[1]: Leaving directory `/reg/g/pcds/epics-dev/bhill/extensions/ca-gateway-git/src' make: *** [src.install] Error 2

bhill-slac commented 2 years ago

I think the key is including caPutLog in the build.

bhill-slac commented 2 years ago

Never mind. Looks like our caPutLog branch is the only one w/ another VALUE_to_string() function. I'll fix it in our branches.