The following issue has been SUBMITTED. ====================================================================== http://www.cmake.org/Bug/view.php?id=15736 ====================================================================== Reported By: Felix Geyer Assigned To: ====================================================================== Project: CMake Issue ID: 15736 Category: Modules Reproducibility: always Severity: minor Priority: normal Status: new ====================================================================== Date Submitted: 2015-09-10 13:46 EDT Last Modified: 2015-09-10 13:46 EDT ====================================================================== Summary: FeatureTesting unreliable Description: The CompileFeatures test fails in Debian on the architecture alpha. My guess is that it's a general problem and other architectures just got lucky.
The problem seems to be that Modules/Internal/FeatureTesting.cmake doesn't add a terminator (\0 or \n for example) at the start of const char features. As a result a printable character can appear in the binary right before "${lang}_FEATURE:". So when cmake extracts strings from the binary it reads "kC_FEATURE:1c_function_prototypes\n". The extra "k" at the start confuses the module as it expects "C_FEATURE". This code in Modules/Internal/FeatureTesting.cmake might be supposed to add a null character at the start: const char features[] = {\"\"\n") However if I'm not mistaken C just concats string literals that are space separated -> it's a noop. Replacing that empty string literal with "\0" fixes the problem. Original bug report with an analysis of the problem: https://bugs.debian.org/789807 ====================================================================== Issue History Date Modified Username Field Change ====================================================================== 2015-09-10 13:46 Felix Geyer New Issue ====================================================================== -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake-developers