https://github.com/amarok24/c_snippets
My snippets in C language, ISO C90/C99.
https://github.com/amarok24/c_snippets
c c90 c99
Last synced: about 1 year ago
JSON representation
My snippets in C language, ISO C90/C99.
- Host: GitHub
- URL: https://github.com/amarok24/c_snippets
- Owner: Amarok24
- License: unlicense
- Created: 2022-09-07T20:32:24.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2022-10-06T15:14:26.000Z (almost 4 years ago)
- Last Synced: 2025-02-16T07:41:21.509Z (over 1 year ago)
- Topics: c, c90, c99
- Language: C
- Homepage:
- Size: 30.3 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# c_snippets
My C snippet collection. Most of it is old-school code (C89/C90, C99), so it should be fairly well portable to most systems, even old computers.
## Compilation of source code with GCC
If you run into troubles when compiling, you might want to tell the GNU C Compiler (GCC) what C standard to use for compilation; here is a very basic example:
```sh
gcc -std=c99 somefile.c -o outputexecutable
```
If the math library is used (if you see `#include ` somewhere on top of the C source), you have to explicitly tell GCC to link the math library (this has historical reasons which I don't understand). Simply put `-lm` (link math) at the end of the compile line:
```sh
gcc -std=c99 somefile.c -o outputexecutable -lm
```
To reduce file size of the executable use the `-s` flag (remove all symbol table information).