Compile and link no problem/error reported? That's strange.
If you are referring to the function name, that is fine.
just like you put a expression "10;", it's fine in C
function name is a pointer to the function so statement expression like
function_1; only generate warning since it is unused. It is not an error.
But other parts of the codes might generate warnings depending on the leniency of the compiler.
To: TS
However there should be an error on forward declaration since the declaration of the function with the "struct library" before the declaration of the functions
There is also a struct declaration mistake
in C, structures MUST have the keyword "struct" used all the time
so "struct library" refers to a structure named "library"
But in the code , there wasn't a structure named "library" at all
Code:
typedef struct { ... } library;
The above did not create structure named "library" so "struct library" must not be used in the code
What is created above is a NEW TYPE onto an anonymous structure and the new type is named "library"
just like
This is to create a NEW TYPE named "_INT32" and the type of it is analogous to an existing type named "int"
For the code to be correct, the order matters
first "typedef struct { ... } library;" should happen before the declaration of the functions having arguments using the new type.
Hence it should be
Code:
typedef struct { ... } library;
void function_1(library);