C is quirky, flawed, and an enormous success. \
... When I read commentary about suggestions for where C should go, I often think back and give thanks that it wasn't developed under the advice of a worldwide crowd. \
... The only way to learn a new programming language is by writing programs in it.
After the Graz, Austria February 2025 WG14 Meeting, I am now confident in the final status of the defer TS, and it is now time.
Link Actions
For the big brain 10,000 meter view, defer ⸺ and the forthcoming TS 25755 ⸺ is a general-purpose block/scope-based “undo” mechanism that allows you to ensure that no matter what happens a set of behavior (statements) are run.
Lions juggling chainsaws are fun to watch, but you wouldn't want them trimming your trees
Link Actions
There's no perhaps about the FBI and CISA getting snippy at buffer overflows. These people worry about exploits that threaten car-crash incidents in enterprise IT, and they've seen enough to get angry. It's not that making mistakes is a crime when writing code. No human endeavor worth doing is without error. It's more that this class of bug is avoidable, and has been for decades, yet it pours out of big tech like woodworm from a church pew. Enough already, they say. They are right.
I've seen a lot of discourse over C build tools. None of them really seem solid except for (some) Makefiles (some Makefiles are atrocious; you just can't rely on people these days). Bazel, cmake - they're just not straight forward like a clean Makefile is, basically black magic, but setting up a Makefile from scratch is a skill. Many copy the same one over each time. Wouldn't it be nice if that Makefile didn't even need to be copied over?
Building C should be straight forward. Grab the C files and headers I want, set some flags, include some libraries, build, link. Instead project build systems are way way way overcomplicated! Like have you ever tried building any of Google's C projects? Nearly impossible to figure out and integrate with projects.
So I've designed a simplistic build system for C (also C++) that is basically set up to work like a normal Makefi
This article is about developing in C for CP/M, using a 40-year-old C compiler, and how this differs from modern C development. The compiler I'm using is the 1982 release of Manx Software Systems' "Aztec C". The compiler is freely, and legally, available from the Aztec Museum. A lot of CP/M software falls into the broad category of "abandonware" -- software that is notionally still protected by intellectual propery law, but whose owners have no interest in it, or cannot even be identified.
A fun, hands-on guide to writing your own compiler for a real-world programming language.
Link Actions
Book Description
Writing a C Compiler will take you step by step through the process of building your own compiler for a significant subset of C—no prior experience with compiler construction or assembly code needed. Once you’ve built a working compiler for the simplest C program, you’ll add new features chapter by chapter. The algorithms in the book are all in pseudocode, so you can implement your compiler in whatever language you like. Along the way, you’ll explore key concepts like:
Lexing and parsing: Learn how to write a lexer and recursive descent parser that transform C code into an abstract syntax tree.
Program analysis: Discover how to analyze a program to understand its behavior and detect errors.
Code generation: Learn how to translate C language constructs like arithmetic operations, function calls, and control-flow statements into x64 assembly code.
Optimization techniques: Improve performance with methods like constant folding, dead store elimination, and re
im new to system programming, idk if thats the issuse. but according gcc, it can not find dbus/dbus-arch-deps.h and thats all i know. any idea about this issue?
undefined
program
[I] tomri@artix ~ [1]> cat main.c
#include <dbus-1.0/dbus/dbus.h>
int main(void) { return 0; }
undefined
# error
[I] tomri@artix ~> gcc main.c
In file included from main.c:1:
/usr/include/dbus-1.0/dbus/dbus.h:29:10: fatal error: dbus/dbus-arch-deps.h: No such file or directory
29 | #include <dbus/dbus-arch-deps.h>
| ^~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
undefined
[I] tomri@artix ~> ls -la /usr/include/dbus-1.0/dbus/
total 216
drwxr-xr-x 2 root root 4096 Jul 2 20:26 ./
drwxr-xr-x 3 root root 4096 Jun 15 21:36 ../
-rw-r--r-- 1 root root 2809 Jan 14 06:17 dbus-address.h
-rw-r--r-- 1 root root 3470 Jan 14 06:17 dbus-bus.h
-rw-r--r-- 1 root root 27018 Jan 14 06:17 dbus-connection.h
-r
It’s now nearly a year that I started writing non-trivial amounts of C codeagain (the first sokol_gfx.h commit was on the 14-Jul-2017), so I guess it’stime f...
CLI Blackjack (21) written in C as practice. Contribute to promitheas17j/blackjack development by creating an account on GitHub.
Link Actions
Hello everyone :)
I recently wrote a small blackjack game where the challenge I set myself (and the learning goal) was to use pointers to do stuff. So for example instead of having all my functions written in such a way as to avoid using pointers I would use them wherever possible.
It works in its current form and seems to do so quite well, but I would like to learn even more from this project. So here I am asking for your experience. Please give me any suggestions, advice, ways to make it more efficient in terms of memory used, ways to make it more efficient in terms of speed (I know memory and speed might not be so important for a small project like this but my goal is to practice and learn the underlying concepts), criticisms, best practices, or anything you that comes to mind when you look at the code.
As an example of what I mean, I would like to make it so that the arrays which hold the player and dealer hands are not of fixed size on declaration, but grow and shrink dynamical
Learn about static analysis improvements coming in GCC 14 with -fanalyzer, which helps identify issues in C code at compile-time, rather than at runtime.