c++ - How works deprecated warnings and how to remove them when using JsonCpp? -
i compiled vs 2015 jsoncpp , able link , everythign works fine.
however, i'm getting tones of deprecated warnings. classes marked depecrated in code:
class jsoncpp_deprecated("use streamwriter instead") json_api writer {...}; with
#define jsoncpp_deprecated(message) __declspec(deprecated(message)) thing don't use classes. i'm getting messages file included. compiling this:
#include <json/json.h> int main( int argc, char* argv[] ) { return 0; } produces 13 deprecated warnings...
isn't warnings supposed reported when deprecated class/function used? there way have work way? (i disable warning c4996, better keep enabled, reported when deprecated class/function used).
i think problem is, classes derive writer. counts being used. have no idea how rid of warnings, though.
edit: tested it. produces same warning 5 times, without being used.
test.h
class __declspec(deprecated("depricated warning unusedclass")) unusedclass { public: void seti(int &val); }; class __declspec(deprecated("depricated warning unusedclass")) unusedclass2 : unusedclass { public: int geti(); int i; }; test.cpp
void unusedclass::seti(int &val) { val = 0; } int unusedclass2::geti() { return 10; } warning:
warning 7 warning c4996: 'unusedclass': depricated warning unusedclass c:\users\admin\documents\test.h 144
Comments
Post a Comment