PS: The compilation errors (after adding the unit tests but not the fix):
g++ -DHAVE_CONFIG_H -DEXEEXT=\"\" -I. -I../../gltests -I..
-DGNULIB_STRICT_CHECKING=1 -DIN_GNULIB_TESTS=1 -I. -I../../gltests -I..
-I../../gltests/.. -I../gllib -I../../gltests/../gllib
-I/media/develdata/devel/inst-x86_64-64/include -Wall -Wno-error -Wno-error -g
-O2 -MT unigbrk/test-unigbrk-h-c++.o -MD -MP -MF $depbase.Tpo -c -o
unigbrk/test-unigbrk-h-c++.o ../../gltests/unigbrk/test-unigbrk-h-c++.cc &&\
mv -f $depbase.Tpo $depbase.Po
In file included from ../../gltests/unigbrk/test-unigbrk-h-c++.cc:20:
../gllib/unigbrk.h:118:1: error: template with C linkage
118 | template <typename T>
| ^~~~~~~~
../gllib/unigbrk.h:39:1: note: ‘extern "C"’ linkage started here
39 | extern "C" {
| ^~~~~~~~~~
../gllib/unigbrk.h:120:1: error: template specialization with C linkage
120 | template <>
| ^~~~~~~~
../gllib/unigbrk.h:39:1: note: ‘extern "C"’ linkage started here
39 | extern "C" {
| ^~~~~~~~~~
../gllib/unigbrk.h:123:1: error: template specialization with C linkage
123 | template <>
| ^~~~~~~~
../gllib/unigbrk.h:39:1: note: ‘extern "C"’ linkage started here
39 | extern "C" {
| ^~~~~~~~~~
../gllib/unigbrk.h:139:1: error: template with C linkage
139 | template <typename T>
| ^~~~~~~~
../gllib/unigbrk.h:39:1: note: ‘extern "C"’ linkage started here
39 | extern "C" {
| ^~~~~~~~~~
../gllib/unigbrk.h:141:1: error: template specialization with C linkage
141 | template <>
| ^~~~~~~~
../gllib/unigbrk.h:39:1: note: ‘extern "C"’ linkage started here
39 | extern "C" {
| ^~~~~~~~~~
../gllib/unigbrk.h:144:1: error: template specialization with C linkage
144 | template <>
| ^~~~~~~~
../gllib/unigbrk.h:39:1: note: ‘extern "C"’ linkage started here
39 | extern "C" {
| ^~~~~~~~~~
../gllib/unigbrk.h:160:1: error: template with C linkage
160 | template <typename T>
| ^~~~~~~~
../gllib/unigbrk.h:39:1: note: ‘extern "C"’ linkage started here
39 | extern "C" {
| ^~~~~~~~~~
../gllib/unigbrk.h:162:1: error: template specialization with C linkage
162 | template <>
| ^~~~~~~~
../gllib/unigbrk.h:39:1: note: ‘extern "C"’ linkage started here
39 | extern "C" {
| ^~~~~~~~~~
../gllib/unigbrk.h:165:1: error: template specialization with C linkage
165 | template <>
| ^~~~~~~~
../gllib/unigbrk.h:39:1: note: ‘extern "C"’ linkage started here
39 | extern "C" {
| ^~~~~~~~~~
../gllib/unigbrk.h:199:1: error: template with C linkage
199 | template <typename T>
| ^~~~~~~~
../gllib/unigbrk.h:39:1: note: ‘extern "C"’ linkage started here
39 | extern "C" {
| ^~~~~~~~~~
../gllib/unigbrk.h:201:1: error: template specialization with C linkage
201 | template <>
| ^~~~~~~~
../gllib/unigbrk.h:39:1: note: ‘extern "C"’ linkage started here
39 | extern "C" {
| ^~~~~~~~~~
../gllib/unigbrk.h:204:1: error: template specialization with C linkage
204 | template <>
| ^~~~~~~~
../gllib/unigbrk.h:39:1: note: ‘extern "C"’ linkage started here
39 | extern "C" {
| ^~~~~~~~~~
../gllib/unigbrk.h:220:1: error: template with C linkage
220 | template <typename T>
| ^~~~~~~~
../gllib/unigbrk.h:39:1: note: ‘extern "C"’ linkage started here
39 | extern "C" {
| ^~~~~~~~~~
../gllib/unigbrk.h:222:1: error: template specialization with C linkage
222 | template <>
| ^~~~~~~~
../gllib/unigbrk.h:39:1: note: ‘extern "C"’ linkage started here
39 | extern "C" {
| ^~~~~~~~~~
../gllib/unigbrk.h:225:1: error: template specialization with C linkage
225 | template <>
| ^~~~~~~~
../gllib/unigbrk.h:39:1: note: ‘extern "C"’ linkage started here
39 | extern "C" {
| ^~~~~~~~~~
../gllib/unigbrk.h:241:1: error: template with C linkage
241 | template <typename T>
| ^~~~~~~~
../gllib/unigbrk.h:39:1: note: ‘extern "C"’ linkage started here
39 | extern "C" {
| ^~~~~~~~~~
../gllib/unigbrk.h:243:1: error: template specialization with C linkage
243 | template <>
| ^~~~~~~~
../gllib/unigbrk.h:39:1: note: ‘extern "C"’ linkage started here
39 | extern "C" {
| ^~~~~~~~~~
../gllib/unigbrk.h:246:1: error: template specialization with C linkage
246 | template <>
| ^~~~~~~~
../gllib/unigbrk.h:39:1: note: ‘extern "C"’ linkage started here
39 | extern "C" {
| ^~~~~~~~~~
make[4]: *** [Makefile:6220: unigbrk/test-unigbrk-h-c++.o] Error 1
g++ -DHAVE_CONFIG_H -DEXEEXT=\"\" -I. -I../../gltests -I..
-DGNULIB_STRICT_CHECKING=1 -DIN_GNULIB_TESTS=1 -I. -I../../gltests -I..
-I../../gltests/.. -I../gllib -I../../gltests/../gllib
-I/media/develdata/devel/inst-x86_64-64/include -Wall -Wno-error -Wno-error -g
-O2 -MT unistr/test-unistr-h-c++.o -MD -MP -MF $depbase.Tpo -c -o
unistr/test-unistr-h-c++.o ../../gltests/unistr/test-unistr-h-c++.cc &&\
mv -f $depbase.Tpo $depbase.Po
In file included from ../../gltests/unistr/test-unistr-h-c++.cc:20:
../gllib/unistr.h:89:1: error: template with C linkage
89 | template <typename T>
| ^~~~~~~~
../gllib/unistr.h:33:1: note: ‘extern "C"’ linkage started here
33 | extern "C" {
| ^~~~~~~~~~
../gllib/unistr.h:91:1: error: template specialization with C linkage
91 | template <>
| ^~~~~~~~
../gllib/unistr.h:33:1: note: ‘extern "C"’ linkage started here
33 | extern "C" {
| ^~~~~~~~~~
../gllib/unistr.h:94:1: error: template specialization with C linkage
94 | template <>
| ^~~~~~~~
../gllib/unistr.h:33:1: note: ‘extern "C"’ linkage started here
33 | extern "C" {
| ^~~~~~~~~~
../gllib/unistr.h:110:1: error: template with C linkage
110 | template <typename T>
| ^~~~~~~~
../gllib/unistr.h:33:1: note: ‘extern "C"’ linkage started here
33 | extern "C" {
| ^~~~~~~~~~
../gllib/unistr.h:112:1: error: template specialization with C linkage
112 | template <>
| ^~~~~~~~
../gllib/unistr.h:33:1: note: ‘extern "C"’ linkage started here
33 | extern "C" {
| ^~~~~~~~~~
../gllib/unistr.h:115:1: error: template specialization with C linkage
115 | template <>
| ^~~~~~~~
../gllib/unistr.h:33:1: note: ‘extern "C"’ linkage started here
33 | extern "C" {
| ^~~~~~~~~~
../gllib/unistr.h:131:1: error: template with C linkage
131 | template <typename T>
| ^~~~~~~~
../gllib/unistr.h:33:1: note: ‘extern "C"’ linkage started here
33 | extern "C" {
| ^~~~~~~~~~
../gllib/unistr.h:133:1: error: template specialization with C linkage
133 | template <>
| ^~~~~~~~
../gllib/unistr.h:33:1: note: ‘extern "C"’ linkage started here
33 | extern "C" {
| ^~~~~~~~~~
../gllib/unistr.h:136:1: error: template specialization with C linkage
136 | template <>
| ^~~~~~~~
../gllib/unistr.h:33:1: note: ‘extern "C"’ linkage started here
33 | extern "C" {
| ^~~~~~~~~~
../gllib/unistr.h:520:1: error: template with C linkage
520 | template <typename T>
| ^~~~~~~~
../gllib/unistr.h:33:1: note: ‘extern "C"’ linkage started here
33 | extern "C" {
| ^~~~~~~~~~
../gllib/unistr.h:522:1: error: template specialization with C linkage
522 | template <>
| ^~~~~~~~
../gllib/unistr.h:33:1: note: ‘extern "C"’ linkage started here
33 | extern "C" {
| ^~~~~~~~~~
../gllib/unistr.h:525:1: error: template specialization with C linkage
525 | template <>
| ^~~~~~~~
../gllib/unistr.h:33:1: note: ‘extern "C"’ linkage started here
33 | extern "C" {
| ^~~~~~~~~~
../gllib/unistr.h:541:1: error: template with C linkage
541 | template <typename T>
| ^~~~~~~~
../gllib/unistr.h:33:1: note: ‘extern "C"’ linkage started here
33 | extern "C" {
| ^~~~~~~~~~
../gllib/unistr.h:543:1: error: template specialization with C linkage
543 | template <>
| ^~~~~~~~
../gllib/unistr.h:33:1: note: ‘extern "C"’ linkage started here
33 | extern "C" {
| ^~~~~~~~~~
../gllib/unistr.h:546:1: error: template specialization with C linkage
546 | template <>
| ^~~~~~~~
../gllib/unistr.h:33:1: note: ‘extern "C"’ linkage started here
33 | extern "C" {
| ^~~~~~~~~~
../gllib/unistr.h:562:1: error: template with C linkage
562 | template <typename T>
| ^~~~~~~~
../gllib/unistr.h:33:1: note: ‘extern "C"’ linkage started here
33 | extern "C" {
| ^~~~~~~~~~
../gllib/unistr.h:564:1: error: template specialization with C linkage
564 | template <>
| ^~~~~~~~
../gllib/unistr.h:33:1: note: ‘extern "C"’ linkage started here
33 | extern "C" {
| ^~~~~~~~~~
../gllib/unistr.h:567:1: error: template specialization with C linkage
567 | template <>
| ^~~~~~~~
../gllib/unistr.h:33:1: note: ‘extern "C"’ linkage started here
33 | extern "C" {
| ^~~~~~~~~~
../gllib/unistr.h:643:1: error: template with C linkage
643 | template <typename T>
| ^~~~~~~~
../gllib/unistr.h:33:1: note: ‘extern "C"’ linkage started here
33 | extern "C" {
| ^~~~~~~~~~
../gllib/unistr.h:645:1: error: template specialization with C linkage
645 | template <>
| ^~~~~~~~
../gllib/unistr.h:33:1: note: ‘extern "C"’ linkage started here
33 | extern "C" {
| ^~~~~~~~~~
../gllib/unistr.h:648:1: error: template specialization with C linkage
648 | template <>
| ^~~~~~~~
../gllib/unistr.h:33:1: note: ‘extern "C"’ linkage started here
33 | extern "C" {
| ^~~~~~~~~~
../gllib/unistr.h:664:1: error: template with C linkage
664 | template <typename T>
| ^~~~~~~~
../gllib/unistr.h:33:1: note: ‘extern "C"’ linkage started here
33 | extern "C" {
| ^~~~~~~~~~
../gllib/unistr.h:666:1: error: template specialization with C linkage
666 | template <>
| ^~~~~~~~
../gllib/unistr.h:33:1: note: ‘extern "C"’ linkage started here
33 | extern "C" {
| ^~~~~~~~~~
../gllib/unistr.h:669:1: error: template specialization with C linkage
669 | template <>
| ^~~~~~~~
../gllib/unistr.h:33:1: note: ‘extern "C"’ linkage started here
33 | extern "C" {
| ^~~~~~~~~~
../gllib/unistr.h:685:1: error: template with C linkage
685 | template <typename T>
| ^~~~~~~~
../gllib/unistr.h:33:1: note: ‘extern "C"’ linkage started here
33 | extern "C" {
| ^~~~~~~~~~
../gllib/unistr.h:687:1: error: template specialization with C linkage
687 | template <>
| ^~~~~~~~
../gllib/unistr.h:33:1: note: ‘extern "C"’ linkage started here
33 | extern "C" {
| ^~~~~~~~~~
../gllib/unistr.h:690:1: error: template specialization with C linkage
690 | template <>
| ^~~~~~~~
../gllib/unistr.h:33:1: note: ‘extern "C"’ linkage started here
33 | extern "C" {
| ^~~~~~~~~~
../gllib/unistr.h:720:1: error: template with C linkage
720 | template <typename T>
| ^~~~~~~~
../gllib/unistr.h:33:1: note: ‘extern "C"’ linkage started here
33 | extern "C" {
| ^~~~~~~~~~
../gllib/unistr.h:722:1: error: template specialization with C linkage
722 | template <>
| ^~~~~~~~
../gllib/unistr.h:33:1: note: ‘extern "C"’ linkage started here
33 | extern "C" {
| ^~~~~~~~~~
../gllib/unistr.h:725:1: error: template specialization with C linkage
725 | template <>
| ^~~~~~~~
../gllib/unistr.h:33:1: note: ‘extern "C"’ linkage started here
33 | extern "C" {
| ^~~~~~~~~~
../gllib/unistr.h:741:1: error: template with C linkage
741 | template <typename T>
| ^~~~~~~~
../gllib/unistr.h:33:1: note: ‘extern "C"’ linkage started here
33 | extern "C" {
| ^~~~~~~~~~
../gllib/unistr.h:743:1: error: template specialization with C linkage
743 | template <>
| ^~~~~~~~
../gllib/unistr.h:33:1: note: ‘extern "C"’ linkage started here
33 | extern "C" {
| ^~~~~~~~~~
../gllib/unistr.h:746:1: error: template specialization with C linkage
746 | template <>
| ^~~~~~~~
../gllib/unistr.h:33:1: note: ‘extern "C"’ linkage started here
33 | extern "C" {
| ^~~~~~~~~~
../gllib/unistr.h:762:1: error: template with C linkage
762 | template <typename T>
| ^~~~~~~~
../gllib/unistr.h:33:1: note: ‘extern "C"’ linkage started here
33 | extern "C" {
| ^~~~~~~~~~
../gllib/unistr.h:764:1: error: template specialization with C linkage
764 | template <>
| ^~~~~~~~
../gllib/unistr.h:33:1: note: ‘extern "C"’ linkage started here
33 | extern "C" {
| ^~~~~~~~~~
../gllib/unistr.h:767:1: error: template specialization with C linkage
767 | template <>
| ^~~~~~~~
../gllib/unistr.h:33:1: note: ‘extern "C"’ linkage started here
33 | extern "C" {
| ^~~~~~~~~~
../gllib/unistr.h:933:1: error: template with C linkage
933 | template <typename T>
| ^~~~~~~~
../gllib/unistr.h:33:1: note: ‘extern "C"’ linkage started here
33 | extern "C" {
| ^~~~~~~~~~
../gllib/unistr.h:935:1: error: template specialization with C linkage
935 | template <>
| ^~~~~~~~
../gllib/unistr.h:33:1: note: ‘extern "C"’ linkage started here
33 | extern "C" {
| ^~~~~~~~~~
../gllib/unistr.h:938:1: error: template specialization with C linkage
938 | template <>
| ^~~~~~~~
../gllib/unistr.h:33:1: note: ‘extern "C"’ linkage started here
33 | extern "C" {
| ^~~~~~~~~~
../gllib/unistr.h:954:1: error: template with C linkage
954 | template <typename T>
| ^~~~~~~~
../gllib/unistr.h:33:1: note: ‘extern "C"’ linkage started here
33 | extern "C" {
| ^~~~~~~~~~
../gllib/unistr.h:956:1: error: template specialization with C linkage
956 | template <>
| ^~~~~~~~
../gllib/unistr.h:33:1: note: ‘extern "C"’ linkage started here
33 | extern "C" {
| ^~~~~~~~~~
../gllib/unistr.h:959:1: error: template specialization with C linkage
959 | template <>
| ^~~~~~~~
../gllib/unistr.h:33:1: note: ‘extern "C"’ linkage started here
33 | extern "C" {
| ^~~~~~~~~~
../gllib/unistr.h:975:1: error: template with C linkage
975 | template <typename T>
| ^~~~~~~~
../gllib/unistr.h:33:1: note: ‘extern "C"’ linkage started here
33 | extern "C" {
| ^~~~~~~~~~
../gllib/unistr.h:977:1: error: template specialization with C linkage
977 | template <>
| ^~~~~~~~
../gllib/unistr.h:33:1: note: ‘extern "C"’ linkage started here
33 | extern "C" {
| ^~~~~~~~~~
../gllib/unistr.h:980:1: error: template specialization with C linkage
980 | template <>
| ^~~~~~~~
../gllib/unistr.h:33:1: note: ‘extern "C"’ linkage started here
33 | extern "C" {
| ^~~~~~~~~~
../gllib/unistr.h:1012:1: error: template with C linkage
1012 | template <typename T>
| ^~~~~~~~
../gllib/unistr.h:33:1: note: ‘extern "C"’ linkage started here
33 | extern "C" {
| ^~~~~~~~~~
../gllib/unistr.h:1014:1: error: template specialization with C linkage
1014 | template <>
| ^~~~~~~~
../gllib/unistr.h:33:1: note: ‘extern "C"’ linkage started here
33 | extern "C" {
| ^~~~~~~~~~
../gllib/unistr.h:1017:1: error: template specialization with C linkage
1017 | template <>
| ^~~~~~~~
../gllib/unistr.h:33:1: note: ‘extern "C"’ linkage started here
33 | extern "C" {
| ^~~~~~~~~~
../gllib/unistr.h:1033:1: error: template with C linkage
1033 | template <typename T>
| ^~~~~~~~
../gllib/unistr.h:33:1: note: ‘extern "C"’ linkage started here
33 | extern "C" {
| ^~~~~~~~~~
../gllib/unistr.h:1035:1: error: template specialization with C linkage
1035 | template <>
| ^~~~~~~~
../gllib/unistr.h:33:1: note: ‘extern "C"’ linkage started here
33 | extern "C" {
| ^~~~~~~~~~
../gllib/unistr.h:1038:1: error: template specialization with C linkage
1038 | template <>
| ^~~~~~~~
../gllib/unistr.h:33:1: note: ‘extern "C"’ linkage started here
33 | extern "C" {
| ^~~~~~~~~~
../gllib/unistr.h:1054:1: error: template with C linkage
1054 | template <typename T>
| ^~~~~~~~
../gllib/unistr.h:33:1: note: ‘extern "C"’ linkage started here
33 | extern "C" {
| ^~~~~~~~~~
../gllib/unistr.h:1056:1: error: template specialization with C linkage
1056 | template <>
| ^~~~~~~~
../gllib/unistr.h:33:1: note: ‘extern "C"’ linkage started here
33 | extern "C" {
| ^~~~~~~~~~
../gllib/unistr.h:1059:1: error: template specialization with C linkage
1059 | template <>
| ^~~~~~~~
../gllib/unistr.h:33:1: note: ‘extern "C"’ linkage started here
33 | extern "C" {
| ^~~~~~~~~~
../gllib/unistr.h:1117:1: error: template with C linkage
1117 | template <typename T>
| ^~~~~~~~
../gllib/unistr.h:33:1: note: ‘extern "C"’ linkage started here
33 | extern "C" {
| ^~~~~~~~~~
../gllib/unistr.h:1119:1: error: template specialization with C linkage
1119 | template <>
| ^~~~~~~~
../gllib/unistr.h:33:1: note: ‘extern "C"’ linkage started here
33 | extern "C" {
| ^~~~~~~~~~
../gllib/unistr.h:1122:1: error: template specialization with C linkage
1122 | template <>
| ^~~~~~~~
../gllib/unistr.h:33:1: note: ‘extern "C"’ linkage started here
33 | extern "C" {
| ^~~~~~~~~~
../gllib/unistr.h:1138:1: error: template with C linkage
1138 | template <typename T>
| ^~~~~~~~
../gllib/unistr.h:33:1: note: ‘extern "C"’ linkage started here
33 | extern "C" {
| ^~~~~~~~~~
../gllib/unistr.h:1140:1: error: template specialization with C linkage
1140 | template <>
| ^~~~~~~~
../gllib/unistr.h:33:1: note: ‘extern "C"’ linkage started here
33 | extern "C" {
| ^~~~~~~~~~
../gllib/unistr.h:1143:1: error: template specialization with C linkage
1143 | template <>
| ^~~~~~~~
../gllib/unistr.h:33:1: note: ‘extern "C"’ linkage started here
33 | extern "C" {
| ^~~~~~~~~~
../gllib/unistr.h:1159:1: error: template with C linkage
1159 | template <typename T>
| ^~~~~~~~
../gllib/unistr.h:33:1: note: ‘extern "C"’ linkage started here
33 | extern "C" {
| ^~~~~~~~~~
../gllib/unistr.h:1161:1: error: template specialization with C linkage
1161 | template <>
| ^~~~~~~~
../gllib/unistr.h:33:1: note: ‘extern "C"’ linkage started here
33 | extern "C" {
| ^~~~~~~~~~
../gllib/unistr.h:1164:1: error: template specialization with C linkage
1164 | template <>
| ^~~~~~~~
../gllib/unistr.h:33:1: note: ‘extern "C"’ linkage started here
33 | extern "C" {
| ^~~~~~~~~~
../gllib/unistr.h:1196:1: error: template with C linkage
1196 | template <typename T>
| ^~~~~~~~
../gllib/unistr.h:33:1: note: ‘extern "C"’ linkage started here
33 | extern "C" {
| ^~~~~~~~~~
../gllib/unistr.h:1198:1: error: template specialization with C linkage
1198 | template <>
| ^~~~~~~~
../gllib/unistr.h:33:1: note: ‘extern "C"’ linkage started here
33 | extern "C" {
| ^~~~~~~~~~
../gllib/unistr.h:1201:1: error: template specialization with C linkage
1201 | template <>
| ^~~~~~~~
../gllib/unistr.h:33:1: note: ‘extern "C"’ linkage started here
33 | extern "C" {
| ^~~~~~~~~~
../gllib/unistr.h:1217:1: error: template with C linkage
1217 | template <typename T>
| ^~~~~~~~
../gllib/unistr.h:33:1: note: ‘extern "C"’ linkage started here
33 | extern "C" {
| ^~~~~~~~~~
../gllib/unistr.h:1219:1: error: template specialization with C linkage
1219 | template <>
| ^~~~~~~~
../gllib/unistr.h:33:1: note: ‘extern "C"’ linkage started here
33 | extern "C" {
| ^~~~~~~~~~
../gllib/unistr.h:1222:1: error: template specialization with C linkage
1222 | template <>
| ^~~~~~~~
../gllib/unistr.h:33:1: note: ‘extern "C"’ linkage started here
33 | extern "C" {
| ^~~~~~~~~~
../gllib/unistr.h:1238:1: error: template with C linkage
1238 | template <typename T>
| ^~~~~~~~
../gllib/unistr.h:33:1: note: ‘extern "C"’ linkage started here
33 | extern "C" {
| ^~~~~~~~~~
../gllib/unistr.h:1240:1: error: template specialization with C linkage
1240 | template <>
| ^~~~~~~~
../gllib/unistr.h:33:1: note: ‘extern "C"’ linkage started here
33 | extern "C" {
| ^~~~~~~~~~
../gllib/unistr.h:1243:1: error: template specialization with C linkage
1243 | template <>
| ^~~~~~~~
../gllib/unistr.h:33:1: note: ‘extern "C"’ linkage started here
33 | extern "C" {
| ^~~~~~~~~~
make[4]: *** [Makefile:6220: unistr/test-unistr-h-c++.o] Error 1