Package: cmake
Version: 3.0.2-1
Forwarded: http://www.cmake.org/Bug/view.php?id=13208
Tags: upstream

The following piece of code fails on debian/jessie:

[...]
include(CheckSymbolExists)
check_symbol_exists(memalign malloc.h HAVE_MEMALIGN)
[...]

$ CFLAGS="-pedantic -pedantic-errors" cmake .

the output states:

Determining if the memalign exist failed with the following output:
Change Dir: /home/mathieu/tmp/flou/bin/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTryCompileExec2230537635/fast"
/usr/bin/make -f CMakeFiles/cmTryCompileExec2230537635.dir/build.make
CMakeFiles/cmTryCompileExec2230537635.dir/build
make[1]: Entering directory '/home/mathieu/tmp/flou/bin/CMakeFiles/CMakeTmp'
/usr/bin/cmake -E cmake_progress_report
/home/mathieu/tmp/flou/bin/CMakeFiles/CMakeTmp/CMakeFiles 1
Building C object
CMakeFiles/cmTryCompileExec2230537635.dir/CheckSymbolExists.c.o
/usr/bin/cc   -pedantic -pedantic-errors -fopenmp    -o
CMakeFiles/cmTryCompileExec2230537635.dir/CheckSymbolExists.c.o   -c
/home/mathieu/tmp/flou/bin/CMakeFiles/CMakeTmp/CheckSymbolExists.c
/home/mathieu/tmp/flou/bin/CMakeFiles/CMakeTmp/CheckSymbolExists.c: In
function ‘main’:
/home/mathieu/tmp/flou/bin/CMakeFiles/CMakeTmp/CheckSymbolExists.c:8:11:
error: ISO C forbids conversion of function pointer to object pointer
type [-Wpedantic]
   return ((int*)(&memalign))[argc];
           ^
CMakeFiles/cmTryCompileExec2230537635.dir/build.make:57: recipe for
target 'CMakeFiles/cmTryCompileExec2230537635.dir/CheckSymbolExists.c.o'
failed
make[1]: Leaving directory '/home/mathieu/tmp/flou/bin/CMakeFiles/CMakeTmp'
make[1]: *** [CMakeFiles/cmTryCompileExec2230537635.dir/CheckSymbolExists.c.o]
Error 1
Makefile:118: recipe for target 'cmTryCompileExec2230537635/fast' failed
make: *** [cmTryCompileExec2230537635/fast] Error 2

File /home/mathieu/tmp/flou/bin/CMakeFiles/CMakeTmp/CheckSymbolExists.c:
/* */
#include <malloc.h>

int main(int argc, char** argv)
{
  (void)argv;
#ifndef memalign
  return ((int*)(&memalign))[argc];
#else
  (void)argc;
  return 0;
#endif
}


--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to