I'm trying to understand an old code not writte by me.
I've a file called task.c with its task.h
. On the task.c
, at the very beginning there's
#define TASK
#include "task.h"
#undef
#include "main.h"
...
extern struct s_system sys;
and in the task.h
there's
#ifndef TASK
extern void myfunc(struct my_Struct *);
...
#endif
I'm trying to understand why it has been build like this instead of just include the .h in the .c like #include "task.h"
My question also comes to the fact that the compiler (I'm using IAR 9.20.4) shows a warning saying that
Warning[Pe231]: declaration is not visible outside of function
on every line of extern void myfunc(struct my_Struct *);