I'm seeing the following warnings from the SunPro compiler when building the 3.15 branch code, which occur because src/libCom/test/epicsAtomicTest.cpp is passing pointers to functions with C++ linkage into epicsThreadCreate() which expects an extern "C" function. The result does run properly everywhere I've tested it, although there might be platforms out there where it won't:
make[1]: Entering directory `/home/phoebus3/ANJ/epics/base/mirror-3.15/src/libCom/test/O.solaris-sparc'
/opt/SUNWspro/bin/CC -c -D_POSIX_C_SOURCE=199506L -D_XOPEN_SOURCE=500 -DUNIX -DSOLARIS=10 -mt -D__EXTENSIONS__ -O +w -I. -I../O.Common -I. -I. -I.. -I../../../../include/compiler/solStudio -I../../../../include/os/solaris -I../../../../include ../epicsAtomicTest.cpp
"../epicsAtomicTest.cpp", line 141: Warning (Anachronism): Formal argument funptr of type extern "C" void(*)(void*) in call to epicsThreadCreate(const char*, unsigned, unsigned, extern "C" void(*)(void*), void*) is being passed void(*)(void*).
"../epicsAtomicTest.cpp", line 225: Where: While instantiating "testIncrDecr<int>()".
"../epicsAtomicTest.cpp", line 225: Where: Instantiated from non-template code.
"../epicsAtomicTest.cpp", line 143: Warning (Anachronism): Formal argument funptr of type extern "C" void(*)(void*) in call to epicsThreadCreate(const char*, unsigned, unsigned, extern "C" void(*)(void*), void*) is being passed void(*)(void*).
"../epicsAtomicTest.cpp", line 225: Where: While instantiating "testIncrDecr<int>()".
"../epicsAtomicTest.cpp", line 225: Where: Instantiated from non-template code.
"../epicsAtomicTest.cpp", line 141: Warning (Anachronism): Formal argument funptr of type extern "C" void(*)(void*) in call to epicsThreadCreate(const char*, unsigned, unsigned, extern "C" void(*)(void*), void*) is being passed void(*)(void*).
"../epicsAtomicTest.cpp", line 226: Where: While instantiating "testIncrDecr<unsigned>()".
"../epicsAtomicTest.cpp", line 226: Where: Instantiated from non-template code.
"../epicsAtomicTest.cpp", line 143: Warning (Anachronism): Formal argument funptr of type extern "C" void(*)(void*) in call to epicsThreadCreate(const char*, unsigned, unsigned, extern "C" void(*)(void*), void*) is being passed void(*)(void*).
"../epicsAtomicTest.cpp", line 226: Where: While instantiating "testIncrDecr<unsigned>()".
"../epicsAtomicTest.cpp", line 226: Where: Instantiated from non-template code.
"../epicsAtomicTest.cpp", line 173: Warning (Anachronism): Formal argument funptr of type extern "C" void(*)(void*) in call to epicsThreadCreate(const char*, unsigned, unsigned, extern "C" void(*)(void*), void*) is being passed void(*)(void*).
"../epicsAtomicTest.cpp", line 227: Where: While instantiating "testAddSub<int>()".
"../epicsAtomicTest.cpp", line 227: Where: Instantiated from non-template code.
"../epicsAtomicTest.cpp", line 175: Warning (Anachronism): Formal argument funptr of type extern "C" void(*)(void*) in call to epicsThreadCreate(const char*, unsigned, unsigned, extern "C" void(*)(void*), void*) is being passed void(*)(void*).
"../epicsAtomicTest.cpp", line 227: Where: While instantiating "testAddSub<int>()".
"../epicsAtomicTest.cpp", line 227: Where: Instantiated from non-template code.
"../epicsAtomicTest.cpp", line 173: Warning (Anachronism): Formal argument funptr of type extern "C" void(*)(void*) in call to epicsThreadCreate(const char*, unsigned, unsigned, extern "C" void(*)(void*), void*) is being passed void(*)(void*).
"../epicsAtomicTest.cpp", line 228: Where: While instantiating "testAddSub<unsigned>()".
"../epicsAtomicTest.cpp", line 228: Where: Instantiated from non-template code.
"../epicsAtomicTest.cpp", line 175: Warning (Anachronism): Formal argument funptr of type extern "C" void(*)(void*) in call to epicsThreadCreate(const char*, unsigned, unsigned, extern "C" void(*)(void*), void*) is being passed void(*)(void*).
"../epicsAtomicTest.cpp", line 228: Where: While instantiating "testAddSub<unsigned>()".
"../epicsAtomicTest.cpp", line 228: Where: Instantiated from non-template code.
"../epicsAtomicTest.cpp", line 208: Warning (Anachronism): Formal argument funptr of type extern "C" void(*)(void*) in call to epicsThreadCreate(const char*, unsigned, unsigned, extern "C" void(*)(void*), void*) is being passed void(*)(void*).
"../epicsAtomicTest.cpp", line 229: Where: While instantiating "testCAS<int>()".
"../epicsAtomicTest.cpp", line 229: Where: Instantiated from non-template code.
"../epicsAtomicTest.cpp", line 208: Warning (Anachronism): Formal argument funptr of type extern "C" void(*)(void*) in call to epicsThreadCreate(const char*, unsigned, unsigned, extern "C" void(*)(void*), void*) is being passed void(*)(void*).
"../epicsAtomicTest.cpp", line 230: Where: While instantiating "testCAS<unsigned>()".
"../epicsAtomicTest.cpp", line 230: Where: Instantiated from non-template code.
"../epicsAtomicTest.cpp", line 208: Warning (Anachronism): Formal argument funptr of type extern "C" void(*)(void*) in call to epicsThreadCreate(const char*, unsigned, unsigned, extern "C" void(*)(void*), void*) is being passed void(*)(void*).
"../epicsAtomicTest.cpp", line 231: Where: While instantiating "testCAS<void*>()".
"../epicsAtomicTest.cpp", line 231: Where: Instantiated from non-template code.
"../epicsAtomicTest.cpp", line 51: Warning: Could not find source for TestDataAddSub<int>::delta.
"../epicsAtomicTest.cpp", line 51: Warning: Could not find source for TestDataAddSub<unsigned>::delta.
13 Warning(s) detected.
/opt/SUNWspro/bin/CC -o epicsAtomicTest -L/home/phoebus3/ANJ/epics/base/mirror-3.15/lib/solaris-sparc -R/home/phoebus3/ANJ/epics/base/mirror-3.15/lib/solaris-sparc -L/usr/local/lib -mt -z ignore -z combreloc -z lazyload -R/usr/local/lib epicsAtomicTest.o -lCom
make[1]: Leaving directory `/home/phoebus3/ANJ/epics/base/mirror-3.15/src/libCom/test/O.solaris-sparc'
I get a similar warning from src/ca/client/acctstRegister.cpp which I can resolve by wrapping the static void acctstCallFunc() definition inside an extern "C" {} block, but I can't do that for epicsAtomicTest.cpp as I then get these errors:
"../epicsAtomicTest.cpp", line 29: Error: Template declarations cannot have extern "C" linkage.
"../epicsAtomicTest.cpp", line 38: Error: Template declarations cannot have extern "C" linkage.
"../epicsAtomicTest.cpp", line 48: Error: Template declarations cannot have extern "C" linkage.
"../epicsAtomicTest.cpp", line 57: Error: Template declarations cannot have extern "C" linkage.
"../epicsAtomicTest.cpp", line 110: Error: Template declarations cannot have extern "C" linkage.
@Andrew, is this still relevant?