C

Update: 2022-04-26: Overhauling to be simplier and bsd/clang friendly. Rules of engagement Style The language Basic Types Integer Types Real and Complex Floating Types void Memory Access Operators Strings The Pre Processor Macros Patterns vtables person_s.h print_vtable.h print_vtable.c main.c Libraries C standard library C POSIX library Unit Testing Sample C code Rules of engagement How I program C by Eskil Steenberg Notes on Programming in C by Rob Pike The Ten Commandments for C Programmers by Henry Spencer Style suckless FreeBSD man 9 style The language Basic Types Integer Types C99 with stdbool.h introduced boolean type _Bool (1 byte), and macros true (1) and false (0). ...

November 26, 2016 · 9 min

Cherished GCC flags

A (work in progress) compilation of useful GCC configuration, focused on C. -W warnings. -Wall is a must. -Werror to treat warnings as errors. -l instructs the linker it has some work to do (i.e. link a library please). -lm is shorthand for -libm and in turn -libm.a is a static library is selected. -L hint to the linker where to locate libraries. -L/opt/gdbm-1.10/src in combination with -lgdbm tells the linker exactly where to find the gdbm libraries. Multiple -L can be specified. Alternatively use the LIBRARY_PATH environment variable like so: ...

August 22, 2015 · 2 min