> The continuous integration uncovered this problem: A testdir with modules > 'bitset' and 'free-posix' fails to build.
Similarly, I get a conflict on Ubuntu 18.04: gcc -g -O2 -o test-linkedhash_set test-linkedhash_set.o libtests.a ../gllib/libgnu.a libtests.a ../gllib/libgnu.a libtests.a -lm -lm -lm -lm -lm -lm -lm -lm -lm -lm -lm depbase=`echo test-list-c++.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\ g++ -DHAVE_CONFIG_H -DEXEEXT=\"\" -I. -I.. -DGNULIB_STRICT_CHECKING=1 -DIN_GNULIB_TESTS=1 -I. -I. -I.. -I./.. -I../gllib -I./../gllib -Wall -g -O2 -MT test-list-c++.o -MD -MP -MF $depbase.Tpo -c -o test-list-c++.o test-list-c++.cc &&\ mv -f $depbase.Tpo $depbase.Po In file included from macros.h:22:0, from test-list-c++.cc:25: test-list-c++.cc: In function 'int main(int, char**)': test-list-c++.cc:75:9: error: 'class gl_List<const char*>' has no member named 'rpl_free'; did you mean 'free'? list2.free (); ^ test-list-c++.cc:76:9: error: 'class gl_List<const char*>' has no member named 'rpl_free'; did you mean 'free'? list1.free (); ^ Makefile:21748: recipe for target 'test-list-c++.o' failed This patch fixes it. 2020-12-29 Bruno Haible <br...@clisp.org> list-c++, [o]map-c++, [o]set-c++: Fix conflict with 'free-posix' module. * lib/gl_list.hh: Include <stdlib.h>. * lib/gl_map.hh: Likewise. * lib/gl_omap.hh: Likewise. * lib/gl_set.hh: Likewise. * lib/gl_oset.hh: Likewise. diff --git a/lib/gl_list.hh b/lib/gl_list.hh index 8b0ccad..85e06b9 100644 --- a/lib/gl_list.hh +++ b/lib/gl_list.hh @@ -23,6 +23,8 @@ #include "gl_sublist.h" #include "gl_xsublist.h" +#include <stdlib.h> /* because Gnulib's <stdlib.h> may '#define free ...' */ + /* gl_List is a C++ wrapper around the gl_list data type. Its element type is 'ELTYPE *'. diff --git a/lib/gl_map.hh b/lib/gl_map.hh index 082694f..8e946d6 100644 --- a/lib/gl_map.hh +++ b/lib/gl_map.hh @@ -21,6 +21,8 @@ #include "gl_map.h" #include "gl_xmap.h" +#include <stdlib.h> /* because Gnulib's <stdlib.h> may '#define free ...' */ + /* gl_Map is a C++ wrapper around the gl_map data type. Its key type is 'KEYTYPE *'. Its value type is 'VALUETYPE *'. diff --git a/lib/gl_omap.hh b/lib/gl_omap.hh index 903befb..953c9c0 100644 --- a/lib/gl_omap.hh +++ b/lib/gl_omap.hh @@ -21,6 +21,8 @@ #include "gl_omap.h" #include "gl_xomap.h" +#include <stdlib.h> /* because Gnulib's <stdlib.h> may '#define free ...' */ + /* gl_OMap is a C++ wrapper around the gl_omap data type. Its key type is 'KEYTYPE *'. Its value type is 'VALUETYPE *'. diff --git a/lib/gl_oset.hh b/lib/gl_oset.hh index 8a7edc9..5150e79 100644 --- a/lib/gl_oset.hh +++ b/lib/gl_oset.hh @@ -21,6 +21,8 @@ #include "gl_oset.h" #include "gl_xoset.h" +#include <stdlib.h> /* because Gnulib's <stdlib.h> may '#define free ...' */ + /* gl_OSet is a C++ wrapper around the gl_oset data type. Its element type is 'ELTYPE *'. diff --git a/lib/gl_set.hh b/lib/gl_set.hh index 3b64bc5..67b4a23 100644 --- a/lib/gl_set.hh +++ b/lib/gl_set.hh @@ -21,6 +21,8 @@ #include "gl_set.h" #include "gl_xset.h" +#include <stdlib.h> /* because Gnulib's <stdlib.h> may '#define free ...' */ + /* gl_Set is a C++ wrapper around the gl_set data type. Its element type is 'ELTYPE *'.