Please enable JavaScript.
Coggle requires JavaScript to display documents.
GCC (Building process (ASSEMBLING ([CMD] gcc -o out_file in_file ([in…
GCC
Building process
ASSEMBLING
[CMD]
gcc -o out_file in_file
[in_file] can be .c file
[in_file] can be .s file
Misc
gcc -c in_file
Generate in_file.o
[Output] fileX.o (object file)
LINKING
COMPILING
[CMD]
gcc -S in_file
[Output] fileX.s (assembly file)
PREPROCESSING
[CMD]
gcc -E [option] in_file
No need to care about option
Preprocessing directives
#error
[Syntax] #error "msg"
Cause preprocessing fail & print out msg
#define
[Misc] Macro should not begin with
__
Because standard & common macros name like that
#include
#include <fileX>
Include file from system dir
[Misc] gcc -E -I ~/demo demo.c
Add "demo" to system dir
#include "fileX"
Include fie from user dir
Searching location order
[2] dir indicated in #include "src\abc.c"
[3] system dir
[1] Current dir with src file
[Misc] gcc - E -iquote src demo.c
Add "src" to user dir
[Misc]
#include "x\\y.h"
include x\\y.h file
#if, ifdef, ifndef, else, endif
#line
line number
#pragma
Difference depends on used compiler
To turn on/off compiler features
[Output] updated contents source file