?! HowTheFu.cc ?!
<< Recipe: Baguettes
>> Linux: Format USB-Stick

2024.09.20
C Development: Compiler Flags

Resources:

GCC Flags

Summary:


# Options I use
-Wall -Wextra -Werror -pedantic -std=c17 -Wformat=2 -Wformat-truncation -Wundef -Wfloat-conversion -Wdouble-promotion -Wshadow -Wcast-align -Wsign-conversion

# Warnings I disable
-Wno-unused-variable -Wno-unused-function -Wno-unused-parameter -Wno-missing-field-initializers -Wno-missing-braces

# Debug flags
-O0 -g -DDEBUG

# Optimized flags
-O3 -march=native

# Other
-Icode/    # Add "code/" to include directories
-lm        # Link library "m"
-o blah    # Sets output file to "blah"

# Also: When using interfacing with Linux,
# you might need to define _POSIX_C_SOURCE
# or _GNU_SOURCE

Options I use:

Warnings I disable:

Debug flags:

Release flags:


<< Recipe: Baguettes
>> Linux: Format USB-Stick
?! HowTheFu.cc ?!