在编译 C 文件期间,我使用idirafter
flag 来提及目录,以查看它是否在使用-I
. 为了模拟这个问题,我编写了一个小示例程序,如下所示。
我不知道为什么,当CLI_CONFIGURE_MODE
展开时,在符号之前和之后添加了一个新行。如果有人可以帮助我,那将非常有帮助。
包含文件: sample.h
#define CLI_CONFIGURE_MODE "/exec/configure"
测试 C 文件: sample.c
#include "sample.h"
#define FORM(cmdstr,modestr) command cmdstr; mode modestr; should be in previous line
FORM("dummy_command" , CLI_CONFIGURE_MODE)
文件的预处理器输出片段:
define __DECIMAL_BID_FORMAT__ 1
# 1 "<command-line>"
# 1 "waste.c"
# 1 "../waste_include/waste.h" 1 3 4
#define CLI_CONFIGURE_MODE "/exec/configure"
# 2 "waste.c" 2
#define FORM(cmdstr,modestr) command cmdstr; mode modestr; should be in previous line
command "dummy_command"; mode
# 5 "waste.c" 3 4
"/exec/configure"
# 5 "waste.c" enter code hereenter code here
; should be in previous line
用于编译文件的命令行:-
x86_64-wrs-linux-gcc -idirafter../waste_include -E -dD waste.c > 1