...
Most C90 implementations do not issue a diagnostic for the violation of this C99 constraint. Many C99 translators will continue to treat such declarations as implying the type int
.
...
Code Block |
---|
|
extern int foo;
|
Noncompliant Code Example (Implicit Function Declaration)
...
Code Block |
---|
|
int main(void) {
int c = foo();
printf("%d\n", c);
return 0;
}
int foo(int a) {
return a;
}
|
...
Code Block |
---|
|
int foo(int);
int main(void) {
int c = foo(0);
printf("%d\n", c);
return 0;
}
int foo(int a) {
return a;
}
|
...
Code Block |
---|
|
foo(void) {
return UINT_MAX;
}
int main(void) {
long long c = foo();
printf("%lld\n", c);
return 0;
}
|
...
Code Block |
---|
|
unsigned int foo(void) {
return UINT_MAX;
}
int main(void) {
long long c = foo();
printf("%lld\n", c);
return 0;
}
|
...
Tool | Version | Checker | Description |
---|
| | | Section |
---|
can detect violations of this rule when the -Wimplicit and -Wreturn-type flags are used |
|
| | | |
| | Section |
---|
IF_MISS_DECL RETVOID.IMPLICIT |
| |
| | | |
| | | |
Related Vulnerabilities
Search for vulnerabilities resulting from the violation of this rule on the CERT website.
...