During the compilation of a C file I used idirafter
flag to mention the directory to look if it does not find the file in any of the locations mentioned using -I
. To simulate the problem I have written a small sample program which is as below.
I am not sure why, when CLI_CONFIGURE_MODE
expands, there is a new line added before and after the symbol. If anyone can help me out then it will be really helpful.
Include file: sample.h
#define CLI_CONFIGURE_MODE "/exec/configure"
Test C file: sample.c
#include "sample.h"
#define FORM(cmdstr,modestr) command cmdstr; mode modestr; should be in previous line
FORM("dummy_command" , CLI_CONFIGURE_MODE)
Snippet of preprocessor output of the file:
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
Command line used to compile the file:-
x86_64-wrs-linux-gcc -idirafter../waste_include -E -dD waste.c > 1