Fix constness in compiler id detection

Since commit 70c2dc8a (Make compiler id detection more robust,
2008-03-10) we store compiler identification strings in test binaries
using the form

  char* info = "info";

Use the const-correct

  char const* info = "info";

form instead.  This allows the C++ compiler identification to work with
"-Werror -Wall" or equivalent flags if the compiler would warn about
const-to-non-const conversion.
This commit is contained in:
Brad King 2010-12-29 15:35:15 -05:00
parent 63d21c1f8e
commit dbc79bd8c8
3 changed files with 4 additions and 4 deletions

View File

@ -85,7 +85,7 @@
getting matched. Store it in a pointer rather than an array
because some compilers will just produce instructions to fill the
array rather than assigning a pointer to a static array. */
char* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]";
char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]";
@CMAKE_C_COMPILER_ID_PLATFORM_CONTENT@

View File

@ -76,7 +76,7 @@
getting matched. Store it in a pointer rather than an array
because some compilers will just produce instructions to fill the
array rather than assigning a pointer to a static array. */
char* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]";
char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]";
@CMAKE_CXX_COMPILER_ID_PLATFORM_CONTENT@

View File

@ -109,6 +109,6 @@
getting matched. Store it in a pointer rather than an array
because some compilers will just produce instructions to fill the
array rather than assigning a pointer to a static array. */
char* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]";
char* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]";
char const* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]";
char const* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]";