Function Definitions followed by Declarations

Hello,

is this legal in TinyC?

int foo(int x) {
    return x;
}

int foo(int x);

This is a redeclaration (with matching signature) but not a redefinition.

Yes, this is legal.

Like you said, the function is only defined once and redeclarations are okay.

1 Like