SQLITE 3.26.0 compiler warning

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

SQLITE 3.26.0 compiler warning

Gary Sanders
When compiling the SQLITE 3.26.0 amalgamation in a C++ project for a Windows build, receive the following compiler warning:

shell.c(16466): warning C4996: 'strdup': The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: _strdup. See online help for details.
1>c:\program files (x86)\windows kits\10\include\10.0.17763.0\ucrt\string.h(536): note: see declaration of 'strdup'

Should be using _strdup instead of strdup.

Created using Visual Studio 2017 15.9.5, Win SDK 10.0.17763.0.

Gary Sanders
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: SQLITE 3.26.0 compiler warning

Clemens Ladisch
Gary Sanders wrote:
> shell.c(16466): warning C4996: 'strdup': The POSIX name for this item is deprecated.

strdup() is now in the dynamic memory TR:
<https://en.cppreference.com/w/c/experimental/dynamic>.

The 'correct' way to get it is:

 #ifdef __STDC_ALLOC_LIB__
 #define __STDC_WANT_LIB_EXT2__ 1
 #else
 #define _POSIX_C_SOURCE 200809L
 #endif
 #include <string.h>
 ...


Regards,
Clemens
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users