Useful gcc/g++ options
-v
Print (on standard error output) the commands executed to run the stages of compilation.
Check include search path order.
-M
Output a rule suitable for make describing the dependencies of the main source file.
List all included headers.
-MM
Like -M
but do not mention header files that are found in system header directories.
List all included headers except for system headers.
-E -P
The output is in the form of preprocessed source code, which is sent to the standard output.
Expand included headers and macros.
-O2
Optimize even more.
Suggest optimization level.
-Og
(v4.8)
Optimize debugging experience.
Optimization with better debug info.
-W -Wall -Werror
Suggest warning options.
Written by kelviN
Related protips
1 Response
@maandree thanks for your suggestion.
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#C
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#