MantisBT - CMake
View Issue Details
0015066CMakeCTestpublic2014-08-06 17:582015-01-05 08:39
Ken Moreland 
Brad King 
normalminorhave not tried
closedfixed 
Windows
CMake 3.0 
CMake 3.1CMake 3.1 
0015066: MSVC level 3 warning in test code
I like to compile my code in MSVC with level 3 warnings on (/W3 compiler flag), but this causes problems with code generated with the create_test_sourcelist() command. (That is, the code in TestDriver.cxx.in.) This code uses the functions strcpy and scanf, and the MSVC compiler gives an error for using each of them because each are notorious for leading to security problems.

Although the use of each of these is correct, TestDriver.cxx.in should be changed to suppress the warning in some way. Either the code should use "safe" alternatives for these functions or the warning should be disabled with something like "#pragma warning(disable : 4996)".
No tags attached.
patch 0001-create_test_sourcelist-Suppress-MSVC-warnings-in-tes.patch (816) 2014-08-07 09:16
https://public.kitware.com/Bug/file/5223/0001-create_test_sourcelist-Suppress-MSVC-warnings-in-tes.patch
Issue History
2014-08-06 17:58Ken MorelandNew Issue
2014-08-07 09:16Brad KingFile Added: 0001-create_test_sourcelist-Suppress-MSVC-warnings-in-tes.patch
2014-08-07 09:17Brad KingNote Added: 0036573
2014-08-07 09:17Brad KingAssigned To => Brad King
2014-08-07 09:17Brad KingStatusnew => assigned
2014-08-07 09:17Brad KingTarget Version => CMake 3.1
2014-08-12 15:45Ken MorelandNote Added: 0036607
2014-08-12 15:51Brad KingNote Added: 0036608
2014-08-18 11:12Brad KingStatusassigned => resolved
2014-08-18 11:12Brad KingResolutionopen => fixed
2014-08-18 11:12Brad KingFixed in Version => CMake 3.1
2015-01-05 08:39Robert MaynardNote Added: 0037613
2015-01-05 08:39Robert MaynardStatusresolved => closed

Notes
(0036573)
Brad King   
2014-08-07 09:17   
Please try "0001-create_test_sourcelist-Suppress-MSVC-warnings-in-tes.patch".
(0036607)
Ken Moreland   
2014-08-12 15:45   
The patch is working for me.
(0036608)
Brad King   
2014-08-12 15:51   
Thanks for testing. Applied:

 create_test_sourcelist: Suppress MSVC warnings in test driver
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=63fc8dcd [^]
(0037613)
Robert Maynard   
2015-01-05 08:39   
Closing resolved issues that have not been updated in more than 4 months