Is there any - at the standard level - protection against the incorrect use of extern ads in C? For example, let in one file there is
extern int global; in another -
double global = 3.1416; After all, mangling names is only in C ++, which, of course, in this situation will protect (at the linker level), unlike C, which must compile and not frown ...
It turns out that in the usual C - only the conscience of the programmer is an obstacle to incorrect use? There is no other mechanism (besides placing the extern declaration in the header file and including it in all project files)?
#define-#ifndef-#endif- nick_n_a#ifndef __global_def #define __global_def double global = 3.1416; #endif#ifndef __global_def #define __global_def double global = 3.1416; #endif- nick_n_a