Your source file is supposed to contain a simple core function:
$ cat file.cc
int main() {
return 0;
}
Then, using the command you showed, the result is as follows:
$ g++ -E file.cc
# 1 "file.cc"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "file.cc"
int main() {
return 0;
}
The result that appears in the question occurs when it is file.ccempty. Note that โemptyโ means that the file can still contain comments or #ifdefblocks with a condition that evaluates to false - since the preprocessor filters them, they also do not appear on the output.
source
share