Warnings:
-Weverything
- even more than-Wpedantic
in Clang
Debugging:
-g
- Preserve debugging symbols-fno-omit-frame-pointer
- if some symbols remain broken-fno-builtin
- Do not perform someprintf
,scanf
,malloc
, etc. optimizations (debugging is easier)-fsanitize=address
- Use address sanitizer-fsanitize=thread
- Use thread sanitizer-fsanitize=undefined
- Use UB sanitizer-fsanitize=memory
- Use memory sanitizer-masm=intel
- Use Intel asm syntax-fverbose-asm
- Add some comments to assembly output
Performance:
-ffast-math
- Allow FP operations to break strict IEEE compilance-ftree-vectorize
- Allow loops vectorization-march=native/skylake
- Optimize for Skylake architecture (I don't think Coffe Lake is here yet)
Shared libraries:
-shared
- Compile as a shared library-fPIC
- Generate position independent code