Export (0) Print
Expand All
Expand Minimize
2 out of 9 rated this helpful - Rate this topic

Compiler Warning (level 1) C4996

'function': was declared deprecated

The compiler encountered a function that was marked with deprecated. The function may no longer be supported in a future release. You can turn this warning off with the warning pragma (example below).

C4996 is generated for the line on which the function is declared and for the line on which the function is used.

You will see C4996 if you are using members of the <hash_map> and <hash_set> header files in the std namespace. See The stdext Namespace for more information.

The following sample generates C4996:

// C4996.cpp
// compile with: /W1
// C4996 expected
#include <stdio.h>
// #pragma warning(disable : 4996)
void func1(void){printf("\nIn func1");}
__declspec(deprecated) void func1(int){printf("\nIn func2");}

int main() {
func1();
func1(1);
}
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.