#c89 — Public Fediverse posts
Live and recent posts from across the Fediverse tagged #c89, aggregated by home.social.
-
“Bitfield Pitfalls”, Michal Necasek, OS/2 Museum (https://www.os2museum.com/wp/bitfield-pitfalls/).
Via HN: https://news.ycombinator.com/item?id=47469945
On Lobsters: https://lobste.rs/s/xtue97/bitfield_pitfalls
#C #Programming #BitFields #Gotchas #C89 #C11 #Bits #SystemsProgramming #Compilers
-
🐢 Oh, look! Someone invented a time machine to take us back to the glorious days of #C89. 🔄 Meanwhile, the rest of the world is busy with, you know, modern programming languages. 🤷♂️
https://gist.github.com/alganet/2b89c4368f8d23d033961d8a3deb5c19 #timeMachine #nostalgia #programmingLanguages #techhumor #HackerNews #ngated -
-
What's the bare minimum #C89 needed to connect to the console in any OS and, in Windows (inc. XP), Linux & MacOS, enable raw mode? Asking for a friend.
Maybe there's a bare-bones framework out there for "give my app a terminal window and make the OS go away" that doesn't involve installing gigabytes of compiler suites and libraries :|
-
I recently wrote a sizeable, though still weekend-scaled, project in old-school C, an interactive disassembler and markup tool, to facilitate a bit of m68k reversing for a synth project.
I'd forgotten how *nice* it is to write green-field C. I wouldn't want this codebase to get any larger, but realloc-doubling buffers and do-it-yourself methods just scream at you to keep it small and focused.
#c89 #retrocomputing -
»Tocaia is a simple and portable Gopher Client built with C89 and POSIX in mind. It offers a TUI interface to explore Gopherspace, with support for menus, text files, searches, and back/forward navigation.«
-
You managed to hit the Giant Bat for 7 damage with your Greatsword.
You were hit by the Giant Bat's Bite attack, you took 5 damage.
You got knocked unconscious and ultimately succumbed to your injuries.
---
🪦 Here lies Max, the Gnome Barbarian❤️ 14 ⭐ 1 🪙 12
⚔️ Greatsword [2d6+2, +4] 🛡️ None [13]
Str 14 Dex 12 Con 14 Int 13 Wis 8 Cha 11
☠️ 0⚒️🧚🧍♂️🏘️🦁☠️
🗺️ 89 🕛 12:01 👤 280
#dndend -
The Giant Bat used Bite, dealing 6 damage to you.
You got knocked unconscious, but managed to get back up.
---
🦁 Giant Bat
❤️❤️❤️💔🖤🖤🖤🖤🖤🖤 9/23
🛡️ 13 ☁️
❕1/4
✨ 50 -
You were hit by the Giant Bat's Bite attack, you took 8 damage.
---
🦁 Giant Bat
❤️❤️❤️💔🖤🖤🖤🖤🖤🖤 9/23
🛡️ 13 ☁️
❕1/4
✨ 50 -
You successfully hit the Giant Bat with your Greatsword for 14 damage.
---
🦁 Giant Bat
❤️❤️❤️💔🖤🖤🖤🖤🖤🖤 9/23
🛡️ 13 ☁️
❕1/4
✨ 50 -
You confronted the Giant Bat!
---
🦁 Giant Bat
❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️ 23/23
🛡️ 13 ☁️
❕1/4
✨ 50 -
You embarked on a journey of adventure.
---
In the distance you see a 🦁 Giant Bat
❤️ 4-40 ☁️ ❕1/4 ✨ 50 -
You purchased the Greatsword and left the shop.
---
You are safe in a small village, what would you like to do? -
You walked to a local shop.
---
Stepping into a quaint shop, you're greeted by Snork, the shopkeeper, who eagerly offers to assist you in your quests.
🎒
⚔️ Halberd [1d10+2, +4] 🛡️ None [13] -
You slept long through the night, regaining 6 hitpoints and 1 hitdice.
---
The walls of a town provide a sense of security, what would you like to do? -
You traveled to a nearby town.
---
You are safe in a town, what would you like to do? -
You successfully ran away!
---
You encounter a 🦁 Giant Owl
❤️ 6-33 ☁️ ❕1/4 ✨ 50 -
You were hit by the Merfolk's Spear attack, you took 6 damage.
You successfully hit the Merfolk with your Halberd for 3 damage.
---
🧍♂️ Merfolk
❤️❤️❤️❤️❤️❤️❤️💔🖤🖤 11/14
🛡️ 11 🌊
❕1/8
✨ 25 -
You confronted the Merfolk!
---
🧍♂️ Merfolk
❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️ 14/14
🛡️ 11 🌊
❕1/8
✨ 25 -
You rested for a moment, regaining 6 hitpoints.
---
Ahead of your path, you see a 🧍♂️ Merfolk
❤️ 4-18 🌊 ❕1/8 ✨ 25 -
You deftly got away!
---
In the distance you see a 🦁 Draft Horse
❤️ 6-33 ❕1/4 ✨ 50 -
The Sprite attacked with its Shortbow, you took 1 damage.
---
🧚 Sprite
❤️❤️ 2/2
🛡️ 15 ☁️
❕1/4
✨ 50 -
You were hit by the Sprite's Shortbow attack, you took 1 damage.
---
🧚 Sprite
❤️❤️ 2/2
🛡️ 15 ☁️
❕1/4
✨ 50 -
The Sprite dealt a critical blow to you with its Longsword, you took 2 damage.
---
🧚 Sprite
❤️❤️ 2/2
🛡️ 15 ☁️
❕1/4
✨ 50 -
The Sprite attacked with its Shortbow, you took 1 damage.
---
🧚 Sprite
❤️❤️ 2/2
🛡️ 15 ☁️
❕1/4
✨ 50 -
The Sprite used Longsword, dealing 1 damage to you.
---
🧚 Sprite
❤️❤️ 2/2
🛡️ 15 ☁️
❕1/4
✨ 50 -
-
You embarked on an unexpected journey.
---
You encounter a 🧚 Sprite
❤️ 1-4 ☁️ ❕1/4 ✨ 50 -
At this point, I could write a program in Visual Basic 6 and it'd be more portable than anything I could hope to do with #C.
Compiling suites have become these constantly moving, hulking behemoths that gain more bloat whilst dropping older platforms, making it practically impossible to compile modern code on retro platforms.
I just want to include a small binary in my repo that can compile a small #C89 program so that the user can get going on anything from a Penitum onwards without downloading gigabytes of dependencies that won't even run.
-
@wader I think I can add a bit of explanation here. MSVCRT.DLL (as a "standard C library") was included with windows for a long time, but they quickly ran into issues with it, most likely caused by not having sane mechanisms for versioning. So, what they did was including a C runtime with each release of their compiler (#MSVC) and expect this runtime to be redistributed with software using it. MSVCRT.DLL had its public API/ABI frozen in a state with #C89 and partial(!) #C99 support and was declared "private" to the OS.
#Mingw (which is also distributed by #MSYS2) nevertheless continued linking to MSVCRT.DLL (and I see why, it's really stupid to have tons of copies of the C runtime ...). So, while the compilers support newer C standards, the standard lib doesn't, and therefore you need quite some hacks and workarounds. And I wouldn't be surprised to find lots of funny misbehavior, that's why I think the issue might indeed be the strftime() from MSVCRT.DLL.
[...] -
#yyjson is an extremely fast #JSON #parser for #C.
yyjson parses and writes JSON data with very high throughput. yyjson uses parallel instructions on modern CPUs to greatly speed up the conversion from and to JSON. yyjson is very competetive with #simdjson, beating it in several tests. yyjson is written in #C89, and works on old hardware without #SIMD.
Website 🔗️: https://github.com/ibireme/yyjson
-
#nmd is a collection of #publicdomain #singleheader libraries.
nmd is a set of #C libraries, including a (dis)assembler for #x86, a 2D graphics library, a sockets library, and a WIP C preprocessor. All nmd utilities are made in #C89 with cross platform support (including cross-framework), allowing for nmd libraries to be used on practically any platform, including #embedded.
Website 🔗️: https://github.com/Nomade040/nmd