mastodon.ie is one of the many independent Mastodon servers you can use to participate in the fediverse.
Irish Mastodon - run from Ireland, we welcome all who respect the community rules and members.

Administered by:

Server stats:

1.6K
active users

#clanguage

0 posts0 participants0 posts today
Replied in thread

@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.

Replied in thread

@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.

groups.google.commalloc(0) fails on AIX and nowhere else I could find ...

We love PostgreSQL for its resiliency, performance, extensibility, and flexibility in adapting to just about any use case. So, we celebrate Postgres today just like every day and wish you, the users (whether long-standing or brand new!) and the community a very happy Valentine’s Day. May you always experience PostgreSQL as being a database you love, too.

Photo credit: Getty Images on Unsplash

Can any #clanguage people give me some suggestions? In my current project, I have a `StringView` struct, which is essentially a pointer and a length. Every time when I need to print it, I need to do something like
```c
printf("%*s", (int)sv.size, sv.start);
```
This is annoying and error-prone. I can also write custom format-print functions, which will also allow me to format-print arbitrary structs. However, then I lose the nice compiler protection against incorrect formats.

I realize that -- these days -- shitting on C is pretty much a cottage industry for some people. It does a lot of things wrong by modern standards, no argument from me. That's absolutely a true statement.

But if you had been around back then, with the hardware we had, and seen the language alternatives, you'd realize why it sparked joy for so many people.

#C#clanguage#1970s

El 12 de octubre de 2011, fallece Dennis Ritchie, científico computacional estadounidense, creador del lenguaje C, y cocreador junto a su colega de toda la vida, Ken Thompson, del SO Unix y el lenguaje B. lamentablemente sufría del corazón y de un cáncer protático avanzado. Falleció a los 70 años y su noticia fue opacada porque una semana antes había fallecido Steve Jobs a quien los medios dieron más difusión
#retrocomputingmx #dennisritchie #unix #clanguage