当我执行 pclint 时,我发现包含头文件在 c / c++ 文件中定义的顺序存在一些问题。
说包含顺序是,
#include <sys/timerfd.h>
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <fcntl.h>
#include <termios.h>
#include <errno.h>
#include <stdarg.h>
#include <string.h>
当我执行 pclint 时,它会给出错误,文件未声明等。
后来我将包含的顺序更改为
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <fcntl.h>
#include <termios.h>
#include <errno.h>
#include <stdarg.h>
#include <string.h>
#include <sys/timerfd.h>
我可以看到很多错误都消失了。我无法弄清楚为什么会出现这种行为。我正在为 C/C++ (NT) Vers 使用 PC-lint。8.00 瓦。
我已将包含路径标记为 +libdir(D:\timesys\nitrogen6x\toolchain\include)
谢谢你,布里杰什