Reputation: 2208
Are there any deprecation between c89/90
c99
c11
c18
? Or only recommendation of avoid certain function like strlen
and use a "safer" strnlen_s
?
Upvotes: 0
Views: 207
Reputation: 213306
Newer standards are not guaranteed to be compatible, even though the committee has a (far too) strong focus on backwards compatibility.
Official recommendations of functions to avoid are found in:
Notably, the official recommendations are free from misguided Microsoft propaganda regarding the string handling functions etc.
Unofficial recommendations by yours sincerely here: Which functions from the standard library must (should) be avoided?.
Upvotes: 2
Reputation: 21532
The following code is valid in C89, deprecated under C99, and invalid in C11 and further, due to its use of the unsafe function gets
:
#include <stdio.h>
int main()
{
char str[100];
puts("What's your name?");
gets(str);
printf("Hello %s!\n", str);
}
Upvotes: 1