We are still actively working on the spam issue.

Difference between revisions of "C Help and Discussion"

From InstallGentoo Wiki
Jump to: navigation, search
(Adds additional section about tools and build opts.)
m (Adds dpt roll from >>92426111 (checked))
Line 41: Line 41:
  
 
- [https://c-faq.com/ C FAQ]
 
- [https://c-faq.com/ C FAQ]
 +
 +
=== Challenge ===
 +
 +
- [https://better-dpt-roll.github.io/ DPT ROLL]
  
 
=== Books ===
 
=== Books ===

Revision as of 21:33, 29 March 2023

The C Programming Logo
A set of challenges

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

- Hello World!

- C FAQ

Challenge

- DPT ROLL

Books

- K&R PDF

- KING PDF

Notable Projects Summited

- Dotris

- TeaChess

- Chad