Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Rule 17.3 when function has definition
#1
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. 
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)