What does "- </ dev / null" mean in "gcc -dM -E - </ dev / null"?
I know that using
gcc -dM -E - < /dev/null can get predefined gcc macros but what does
- < /dev/null mean in this team? In my opinion, there should be an option - . I tried to search for gcc manual but cannot find the answers.
By itself - means "read from standard input instead of the file name that would otherwise be provided on this command line." This is a general Unix convention.
< /dev/null redirects standard input from /dev/null , which has a length of 0. Thus, GCC will read from standard input and immediately go to the end of the input, forcing it to print only predefined macros (and not any input macros, therefore that there is no input). This is the standard shell syntax not related to GCC invocation.
Together, they may not contribute to a process that awaits some.