centos5: cmListFileLexer.c:2577:5: error: implicit declaration of function ‘strdup’
The current master fails on centos5:
-- The CXX compiler identification is GNU 4.8.2
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /opt/rh/devtoolset-2/root/usr/bin/gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /opt/rh/devtoolset-2/root/usr/bin/g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Checking if compiler supports C11 _Thread_local
-- Checking if compiler supports C11 _Thread_local - no
-- Checking if compiler supports needed C++14 constructs
-- Checking if compiler supports needed C++14 constructs - no
-- Checking if compiler supports C++ make_unique
-- Checking if compiler supports C++ make_unique - no
-- Checking if compiler supports C++ unique_ptr
-- Checking if compiler supports C++ unique_ptr - yes
...
/usr/local/src/cmake/Source/LexerParser/cmListFileLexer.c: In function ‘cmListFileLexerSetToken’:
/usr/local/src/cmake/Source/LexerParser/cmListFileLexer.c:2577:5: error: implicit declaration of function ‘strdup’ [-Werror=implicit-function-declaration]
lexer->token.text = strdup(text);
^
/usr/local/src/cmake/Source/LexerParser/cmListFileLexer.c:2577:23: warning: assignment makes pointer from integer without a cast [enabled by default]
lexer->token.text = strdup(text);
^
cc1: some warnings being treated as errors
make[2]: *** [Source/CMakeFiles/CMakeLib.dir/LexerParser/cmListFileLexer.c.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [Source/CMakeFiles/CMakeLib.dir/all] Error 2
is this still supported ?
to reproduce:
$ curl -fsSL https://github.com/libuv/libuv/archive/v1.23.0.tar.gz | tar xz && cd libuv-1.23.0 \
&& ./autogen.sh && ./configure --prefix=/usr --libdir=/usr/lib64 --disable-static && make && make install
$ git clone --depth 1 https://gitlab.kitware.com/cmake/cmake.git && cd cmake && ./bootstrap --parallel=8 --bootstrap-system-libuv -- -DCMAKE_USE_SYSTEM_LIBRARY_LIBUV=ON -DCMAKE_USE_OPENSSL=OFF && make install
Edited by Brad King