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:
parent
63d21c1f8e
commit
dbc79bd8c8
|
@ -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@
|
||||
|
||||
|
|
|
@ -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@
|
||||
|
||||
|
|
|
@ -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 "]";
|
||||
|
||||
|
|
Loading…
Reference in New Issue