this post was submitted on 30 Dec 2024
521 points (98.5% liked)

Programmer Humor

19880 readers
152 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 2 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] addie@feddit.uk 7 points 6 days ago (1 children)

To be fair, compiling C code with a C++ compiler gets you all the warnings from C++'s strong-typing rules. That's a big bonus for me, even if it only highlights the areas of your C that are likely to become a maintenance hazard - all those void* casts want some documentation about what assumptions make them safe. Clang will compile variable-length arrays in C++, so you might want to switch off that warning since you've probably intended it. Just means that you can't use designated initialisers, since C++ uses constructors for that and there's no C equivalent. I'd be happy describing code that compiles in either situation as "C+".

Also stops anyone using auto, constexpr or nullptr as variable names, which will help if you want to copy-paste some well-tested code into a different project later.

[–] Sonotsugipaa@lemmy.dbzer0.com 1 points 6 days ago (1 children)
[–] Opisek@lemmy.world 2 points 6 days ago

It means something else.