...
Code Block | ||
---|---|---|
| ||
#include <stdio.h>
extern char *strchr();
int main(void) {
char *c = strchr(12, 5);
printf("Hello %c!\n", *c);
return 0;
}
|
Section 6.11 of the C99 standards, "Future language directions", states that "The use of function declarators with empty parentheses (not prototype-format parameter type declarators) is an obsolescent feature." The use of these declarations prevents the compiler from performing type checking.
...
Code Block | ||
---|---|---|
| ||
#include <stdio.h>
#include <string.h>
int main(void) {
char *c = strchr("world", 'w');
printf("Hello %c!\n", *c);
return 0;
}
|
Non-Compliant Code Example 2
...