5 ms·
looked up these flags, since I didn't know all of them: -C: compile but do not link (I think this is covered by -E) -E: stop after running the preprocessor -
by ndesaulniers 9y ago
looked up these flags, since I didn't know all of them:
-C: compile but do not link (I think this is covered by -E)
-E: stop after running the preprocessor
-H: print the name of each header file included, indenting child #includes (what do you use this for? is it printed to stderr?)
-P: inhibit the generation of line markers from the preprocessor (I've used this before, but can't recall the problem it solves? Not expanding __LINE__?)
-nostdinc: do not search standard system directories for header files (/usr/include, /usr/local/include, ..., this is standard in the Linux kernel, since there is no libc)
-undef: do not predefine any system-specific or GCC macros (probably to not expand occurrences of sequences like "__GNUC__" and others from unexpectedly being expanded).
-x <language>: specify the language, rather then letting the compiler guess based on the file extension (is this required?)
- Goopplesoft 9y agoThanks. Also, this site also seems to have args from man pages: https://explainshell.com/explain?cmd=gcc+-C+-E+-H+-P+-nostdinc+-undef+-x+c+%24main+-o+%24out https://explainshell.com/explain?cmd=gcc+-C+-E+-H+-P+-nostdi...
- ndesaulniers 9y agoThat's a neat utility! Thanks for sharing.
- dima55 9y agoyou mixed up -c and -C. Here he's preserving comments
- ksherlock 9y ago> -P: inhibit the generation of line markers from the preprocessor (I've used this before, but can't recall the problem it solves? Not expanding __LINE__?) It prevents #line directives which are useful for a C compiler but erroneous for javascript.