Compilation
suggest changeC defines translation phases and observable program behavior, not a required set of toolchain files. Native implementations commonly use these file types:
| Extension | Conventional purpose |
|---|---|
.c |
C source |
.h |
header |
.o, .obj |
object file |
.a, .lib |
static library |
.so, .dylib, .dll |
shared library |
.exe |
executable on Windows |
These are conventions, not ISO C requirements.
GCC and Clang commonly support:
| Option | Purpose |
|---|---|
-std=c23 |
select the C23 language mode |
-Wall -Wextra |
enable useful warnings |
-pedantic |
diagnose many extensions to the selected standard |
-Wconversion |
diagnose many implicit conversions |
-c |
compile without linking |
-o file |
name the output |
-I directory |
add a header search directory |
-L directory |
add a library search directory |
-l name |
request a library |
-D name=value |
define a preprocessing macro |
Options differ between toolchains and versions. -Wall does not literally enable every warning, and -Werror can make builds brittle when a compiler adds new diagnostics. Select warnings deliberately and investigate them rather than copying a flag set without understanding it.
See Compiling and linking for a basic command-line workflow.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents