声明定义R-1-1-22强制
禁止重复包含头文件
头文件重复包含
foo.h
1int the_var;
bar.h
1#include "foo.h"
test.c
1#include "bar.h"2#include "foo.h"禁止重复包含头文件 [gjb8114-r-1-1-22]
头文件重复包含
foo.h
1int the_var;
bar.h
1#ifndef _FOO_H_2#define _FOO_H_3#include "foo.h"4#endif
test.c
1#include "bar.h"2#ifndef _FOO_H_3#define _FOO_H_4#include "foo.h"5#endif