From 9f0e5d00ab51cc7c0dc87c8d72f48c4e6edaf120 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 11 Jun 2014 10:48:37 +0200 Subject: [PATCH] Enforce strict string literal behaviors with MSVC 2013 MSVC 2013 implements the behavior mandated by C++11 that removes the ability to downconvert a string literal to a modifiable char*, but it's not enabled by default. This option turns it on. It's only enabled for release builds because the compiler page has a note saying the Standard Library has bugs that prevent it from working in debug mode. See http://msdn.microsoft.com/en-us/library/dn449508.aspx Visual Studio "14" has this fixed. [ChangeLog][Compiler Specific Changes] Release builds with Microsoft Visual Studio 2013 now enable the standard-conforming C and C++ strict string behavior. This option will be enabled in all builds with future Visual Studio versions. Non-conforming code should be fixed for maximum portability and correctness. See http://msdn.microsoft.com/en-us/library/dn449508.aspx for more information. Change-Id: If5ba6cc8456209b268e047d1010710fe332b8312 Reviewed-by: Joerg Bornemann --- mkspecs/win32-msvc2013/qmake.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mkspecs/win32-msvc2013/qmake.conf b/mkspecs/win32-msvc2013/qmake.conf index 6e0bd0b214d..535904a8f9c 100644 --- a/mkspecs/win32-msvc2013/qmake.conf +++ b/mkspecs/win32-msvc2013/qmake.conf @@ -25,8 +25,8 @@ QMAKE_YACCFLAGS = -d QMAKE_CFLAGS = -nologo -Zm200 -Zc:wchar_t -FS QMAKE_CFLAGS_WARN_ON = -W3 QMAKE_CFLAGS_WARN_OFF = -W0 -QMAKE_CFLAGS_RELEASE = -O2 -MD -QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += -O2 -MD -Zi +QMAKE_CFLAGS_RELEASE = -O2 -MD -Zc:strictStrings +QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += -O2 -MD -Zi -Zc:strictStrings QMAKE_CFLAGS_DEBUG = -Zi -MDd QMAKE_CFLAGS_YACC = QMAKE_CFLAGS_LTCG = -GL