#clanguage

2025-07-10

I've been #programming in the #CLanguage since 1989. #TIL you CAN return memory obtained by alloca() without terminating the function. Just give it a size that is two's complement negative: alloca(-40) to give back 40 bytes. That becomes SIZE_MAX - 40, whose wraparound arithmetic will move the stack pointer in the direction toward the stack bottom.

Usual disclaimers apply: it's nonstandard and compiler/platform dependent. Maybe some allocas guard against that and blow up.

2025-06-27

@cks @whitequark

It's interesting comparing Usenet of 1993 to Hacker News of today. Some questions are perennial, it seems:

"But what use is malloc(0)?" followed by a discussion of people rolling their own Pascal-like strings.

"Why unique?" followed by a discussion of making sets and maps.

"It's not a valid pointer." leading to the usual pantomime rejoinder.

I haven't seen anyone ask what the old implementations that returned NULL did to errno, though.

#CLanguage #StandardC #C89 #POSIX1 #malloc #SVID

Mille e Una Avventura1001avventura@mastodon.uno
2025-06-27

Recuperiamo un mio vecchio programma del 1993 per MS-DOS realizzato con il Turbo C++ della Borland: il classico insieme di Mandelbrot in grafica VGA a 16 colori. Questa volta per il recupero ho usato i dischetti originali. #clanguage #programming #borland #mandelbrot youtube.com/watch?v=Bp5h-AMeRf

2025-06-26

@cks @whitequark

Back in 1993, #AIX was the example that people gave of a C library where malloc(0) returned NULL.

groups.google.com/g/comp.unix.

Most of the C libraries that I touched back then either just handed off to the operating system's API for suballocation, which did not treat zero specially, or had their own suballocation functions, which did not treat zero specially.

#CLanguage #StandardC #C89 #POSIX1 #malloc #SVID

Rin3dRin3d
2025-06-21

Rust is just what you get when you make a C compiler that enforces the best practices of C.

2025-06-17

I just changed most, just shy of all, of the K&R function definitions, that should have gone away decades ago, in #djbwares to the new 1989 way of doing things.

Tedious, but worth it for when 2023 comes around, as the 2024 C compiler is warning me will happen quite soon. (-:

#CLanguage

Mille e Una Avventura1001avventura@mastodon.uno
2025-05-28

Mettiamo a confronto varie tecniche di programmazione per scoprire qual è la più performante. Il classico algoritmo che approssima Pi greco con il metodo di Montecarlo viene implementato con un singolo thread, con le SIMD AVX2, multithreaded sulla CPU e, poi, su una GPU Nvidia sfuttando CUDA. Quali performance otterremo? #clanguage #cuda #multithreading #mandelbrot #cplusplus #visualstudio #programming youtube.com/watch?v=NyaGaUeDck

Mille e Una Avventura1001avventura@mastodon.uno
2025-05-24

Una carrellata di IDE e compilatori per il linguaggio C/C++. Alcuni antiquati ed altri più attuali con estensioni AI. #clanguage #programming #compiler #ide #artificialintelligence youtube.com/watch?v=S0SEa55O3i

2025-05-23

Do you guys know a good C/C++ ide? I don't like Code::Blocks and I don't need Clion (for now?)

Edit: of course it's out of the question to use a Microsoft product.

#C #clang #clanguage #Dev #solodev #programming #coding

Revista Occam's RazorRevistaOccamsRazor@masto.es
2025-05-17

El artículo sobre volcado de memoria en tiempo de ejecución ahora en video:

youtu.be/dPUSQTXn8_E

#programacion #clanguage #hacking #linux #programming #c #tools #herramientas

Mille e Una Avventura1001avventura@mastodon.uno
2025-05-17

Dopo anni è comparso un nuovo aggiornamento il 25.03 dell'IDE Code::Blocks. 20 anni fa lo avevo utilizzato per programmare il mio APOCALYX 3D Engine! #programming #codeblocks #ide #clanguage youtube.com/watch?v=m32gXrrpHP

Erik C. Thauvinethauvin
2025-04-25

GCC 15.1 Released With COBOL Compiler & Many Other Improvements

phoronix.com/news/GCC-15.1-Rel

Rachael Ava 💁🏻‍♀️RachaelAva1024@tech.lgbt
2025-04-18
Martin Ueckeruecker
2025-04-14

I put an overview of my preliminary (!) analysis of undefined behavior in the core language and the status in C2Y into the ISO WG14 document log.
open-std.org/jtc1/sc22/wg14/ww

2025-03-12

At last someone has articulated my thoughts about C memory safety. The solution exists and is very robust: ADA.
If only I could convince management to use that instead of C/C++. Instead they're more likely to find Rust the more attractive option 😔
hackaday.com/2025/03/11/trapc-

#clanguage #cplusplus #ada #hackadaycolumns

2025-02-28

Retour vers le futur session de degug #asterisk en #clanguage une occasion de tester #clion de #jetbrains puisque j'ai pris le pack complet d'outils

Client Info

Server: https://mastodon.social
Version: 2025.04
Repository: https://github.com/cyevgeniy/lmst