Tips for C Programming from Nic Barker - If you’re going to be a hacker, learning C is a rite of passage. If you don’t have... - https://hackaday.com/2025/10/07/tips-for-c-programming-from-nic-barker/ #softwaredevelopment #cprogramming #tips
Last week's little win
Figured out how to cross-compile my C projects and libraries like Raylib & SDL for #Windows under my #Linux system!
Now I can make builds of my game for my graphics artist (who uses Windows) without me having to actually boot Windows.
(Currently I am just putting all of my findings into my own growing Makefile. At some point I might switch to CMake, but at least right now, I feel that I learn more by doing it this way.)
NL: Vandaag zijn wij open vanaf 14:00. Er is een Linux repair cafe en een C programmeer club!
EN: Today we are open from 14:00. Today there will be a Linux repair cafe and a C programming club / "hack-a-book club".
Meer informatie / more information:
TIL: NetBSD has the file NetBSD.el in /usr/share/misc/ for setting its C programming style in EMACS
Coming back to this:
Thanks to the help of a nice person on Discord, I was able to figure out how to get the "could be const" warning on the command line:
https://mastodon.gamedev.place/@duke_of_germany/115158854069196552
C Programming
Finally found out how to get a warning on the command line if a variable in my C program could be const!
It works via clang-tidy:
clang-tidy --checks='-*,misc-const-correctness' main.c -- -xc++
The important trick is the "-xc++" flag at the end, because for some reason, clang-tidy only wants to run this check on C++ files.
The flag convinces it to treat a C file as a C++ file, and the check works!
For one of my C projects, I try to use the #zig compiler as a drop-in replacement for gcc.
Basically works, but:
With the flag "-fsanitize=address" enabled, zig cannot find libasan (even though it is installed and is found by gcc).
Did anybody experience this before and knows a fix?
@sirwumpus @mirsadra there's no need to port to Rust. #Rust is a great language with great tooling, but the philosophy is kind of outdated already.
Instead, use modern tools to make your existing C code "safe". Like: https://fil-c.org
If one wants to port or write something new, use a modern language that can be formally verified by design. Like #Idris 2: https://www.idris-lang.org/
New versión of Goophy up and running my gopher hole.
Today:
- Fixed a few bugs. I hope it will no longer dies. Ok it only happened twice, but one time is already too much for my taste
- Improved the logs
- Allowed some requests to pass, according to what I've seen in the logs.
- Improved requests validation according to what I've seen in the logs. Requests like http are detected early so there is less waste of resources.
Working on fixing and improving things on Goophy. Time for another coffee. After all programming is the process of inputting caffeine and outputting software
Operator Overload podcast - we look at cmdmp3.c ... a command-line MP3 player for Windows. #programming #cprogramming
After almost 2 days online I can say that Goophy is doing well. I already have my gopherhole with more content online and I made it bilingual English / Spanish but I don't plan to keep 1-1 translations of everything. We will see.
Some screenshots below for showing it up & running. The client used is Lagrange Gemini / Gopher client.
You can visit my gopherhole at gopher://lucio.albenga.es
A new gopher hole and gopher server are born!!
Finally the first private beta of Goophy is up and running on the Raspberry Pi with NetBSD. You can check it out with your favorite gopher client at:
gopher://lucio.albenga.es
I promise I'll put more content in the following days, but right now I'm excited to have it online Let me know if you find any bugs.
Neuer Blog: „time_t Cast Away: Bits über Bord und der Y2K38 Bug ist zurück“
Die Umstellung auf 64-Bit-time_t gilt als Lösung für das Year 2038 Problem. Doch Direct Casts machen den Fix schnell unwirksam – und schicken uns zurück ins Jahr 1901.
Auf das Wortspiel bin ich ein bisschen stolz
Mission accomplished!
Config file works as expected and with this I'm ready for a first private beta
Next step: installing NetBSD on my Raspberry Pi 2 for putting this online and see what happens
Today I'm working on a config file system for the server. We will see how it goes
After writing so much software in C# and TypeScript during the past years, I felt a bit burned out.
- Decided I need a little "OOP detox"
- Dived a little into Rust for a while
- Result: great language, but did not fully click in some aspects
So now I am doing the only sensible thing:
Getting back into C.
Finally I have a working logging system. Yesterday I had almost completed a first version but today I thought, wouldn’t it be better if…? And I jumped at it
There is room for improvement but I'm quite happy with it right now. I hope to have my private beta ready this week.