hello friends! new(ish)!
C Help and Discussion: Difference between revisions
>Emil (Reformatted page and added challenge image.) |
>Emil (Adds additional section about tools and build opts.) |
||
Line 5: | Line 5: | ||
Show what your working on, and go mess around someones else's code. | Show what your working on, and go mess around someones else's code. | ||
== Tools == | |||
=== Building and Build systems === | |||
==== Makefiles ==== | |||
"A Makefile a day keeps the doctor away." - me | |||
Makefiles provide a very useful basis and if you fully grasp them, you can do most anything with enough investment. Though in most cases it's better to use Makefiles for small and simple projects. | |||
==== Autobuild ==== | |||
A hellish extension of make. Stub. | |||
==== CMake ==== | |||
CMake is a multi-platform build system that is the defacto successor to Autobuild. It's generally considered to have bad syntax, but can cover most needs with enough effort. | |||
==== Meson ==== | |||
CMake with better syntax. | |||
== Recommended Build Options == | |||
=== Warnings === | |||
For GCC, it is generally recomended to use `-Werror -Wall -Wextra -Wpedantic`; and for Clang it's recommended to use `-Werror -Weverything`. | |||
=== Release options === | |||
`-O2 -DNDEBUG` Provides good optimizations, and `-Os` is generally discouraged due to some bad trade offs that may occur reducing optimization greatly. | |||
=== Debug options === | |||
`-Og -g`, use `-ggdb` if you intend to use that tool. | |||
== C Misconceptions == | == C Misconceptions == | ||
=== C is a small language! === | === C is a small language! === | ||
C is often called a small language but this is simply not true. Its small RELATIVE to other languages. The set of information that is C is quite large on its own and takes a long time to master completely ("Master" could be defined as the ability to write a working standards-compliant compiler). | C is often called a small language but this is simply not true. Its small RELATIVE to other languages. The set of information that is C is quite large on its own and takes a long time to master completely ("Master" could be defined as the ability to write a working standards-compliant compiler). | ||
=== C has no package manager! === | |||
C has many, many package managers, one for every GNU/Linux Distribution. | |||
== Useful Links == | == Useful Links == |
Revision as of 20:31, 29 March 2023
C Help and Discussion is an ongoing general. In it people discuss C/C++ programming, projects that they and others are working on. Show what your working on, and go mess around someones else's code.
Tools
Building and Build systems
Makefiles
"A Makefile a day keeps the doctor away." - me
Makefiles provide a very useful basis and if you fully grasp them, you can do most anything with enough investment. Though in most cases it's better to use Makefiles for small and simple projects.
Autobuild
A hellish extension of make. Stub.
CMake
CMake is a multi-platform build system that is the defacto successor to Autobuild. It's generally considered to have bad syntax, but can cover most needs with enough effort.
Meson
CMake with better syntax.
Recommended Build Options
Warnings
For GCC, it is generally recomended to use `-Werror -Wall -Wextra -Wpedantic`; and for Clang it's recommended to use `-Werror -Weverything`.
Release options
`-O2 -DNDEBUG` Provides good optimizations, and `-Os` is generally discouraged due to some bad trade offs that may occur reducing optimization greatly.
Debug options
`-Og -g`, use `-ggdb` if you intend to use that tool.
C Misconceptions
C is a small language!
C is often called a small language but this is simply not true. Its small RELATIVE to other languages. The set of information that is C is quite large on its own and takes a long time to master completely ("Master" could be defined as the ability to write a working standards-compliant compiler).
C has no package manager!
C has many, many package managers, one for every GNU/Linux Distribution.
Useful Links
Getting started
- C FAQ
Books
- K&R PDF
- KING PDF
Notable Projects Summited
- Dotris
- TeaChess
- Chad