I am working on a legacy pro* C/C++ code and migrated the project to Visual Studio 2015. When I compile the code in VS, it is giving me a below warning message at more than 100 places.
warning C4267: '=': conversion from 'size_t' to 'unsigned short', possible loss of data
and the corresponding code is
stmt.len = strlen((char*)stmt.arr); // VARCHAR stmt[500];
I was planning to change the above code to
stmt.len = static_cast<unsigned short>(strlen((char *)stmt.arr));
this will just remove the warning message. But I have to modify in more than 100 places. Is there any way to get rid of this warning message may be using some sort of macro? Please suggest.
Thanks