loguru icon indicating copy to clipboard operation
loguru copied to clipboard

VS2017 - error C4996: 'strdup': The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: _strdup.

Open YukinoHayakawa opened this issue 6 years ago • 3 comments

YukinoHayakawa avatar Jul 08 '18 13:07 YukinoHayakawa

Here is what my loguru implementation file looks like. My project uses warning level 4.

#include "stdafx.h"

#pragma warning( push )
#pragma warning( disable : 4100) //unreferenced parameters
#pragma warning( disable : 4996) //security warnings, strcpy and such

//silences warnings about "nonstandard" function
#define strdup _strdup
#define LOGURU_IMPLEMENTATION 1
#include "../loguru/loguru.hpp"
#undef strdup
#pragma warning( pop )

dbremner avatar Aug 03 '18 00:08 dbremner

It might be a workaround, but it would be better if it could be solved in the library.

YukinoHayakawa avatar Aug 10 '18 10:08 YukinoHayakawa

This should be easy to add to Loguru, but without access to VS2017 I don't think I should be the one making the PR. Any takers?

emilk avatar Sep 19 '18 15:09 emilk