15-06-2023, 02:32 PM
I wonder if the code below violates rule 17.3:
void dostuff(int x) {
// do some stuff..
}
void func(void) {
dostuff(12); // <- is 17.3 violated here?
}
Please note that the functions dostuff and func violates rule 8.4 and don't have prototypes.
Question: is 17.3 violated when calling a function that violates rule 8.4?
The rationale for 17.3 also does not apply to my example code as far as I understand:
If a function is declared implicitly, a C90 compiler will assume
that the function has a return type of int. Since an implicit
function declaration does not provide a prototype, a compiler will
have no information about the number of function parameters and
their types.
void dostuff(int x) {
// do some stuff..
}
void func(void) {
dostuff(12); // <- is 17.3 violated here?
}
Please note that the functions dostuff and func violates rule 8.4 and don't have prototypes.
Question: is 17.3 violated when calling a function that violates rule 8.4?
The rationale for 17.3 also does not apply to my example code as far as I understand:
If a function is declared implicitly, a C90 compiler will assume
that the function has a return type of int. Since an implicit
function declaration does not provide a prototype, a compiler will
have no information about the number of function parameters and
their types.