Endless recursive macros results in SEGFAULT
I implemented a macro and, by accident, it called itself. If this occurs, cmake segfaults. I know it is more a programming mistake by me, but somehow unexpected behavior.
Tested with>
- cmake 3.5.2 (Ubuntu) [Generator Unix Makefiles]
- cmake 3.7.0 (Windows) [Generator MinGW Makefiles]
macro(MY_MACRO _name)
MY_MACRO(${ARGV})
endmacro()
MY_MACRO(SOMETHING)
Output on Ubuntu using 3.5.2:
dennis@noname:~/hack/cmake$ cmake .
-- The C compiler identification is GNU 6.2.0
-- The CXX compiler identification is GNU 6.2.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
Segmentation fault (core dumped)
Edited by Brad King