this post was submitted on 09 Feb 2026
49 points (98.0% liked)

Programmer Humor

41127 readers
178 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 6 years ago
MODERATORS
 

Alt text:

Transcendence meme template

function main() {...}

int main() {...}

void main() {...}

U0 main() {...}

/* HolyC example */
U0 Main()
{
  U8 *message = "hello world";
  "%s\n",message;
}
Main;
you are viewing a single comment's thread
view the rest of the comments
[โ€“] labsin@sh.itjust.works 9 points 2 weeks ago (1 children)

In c they do indeed just mean shorter and longer int as the size of the int is defined by the compiler and target and originally represented the hardware.

There are types like int32_t or int_least16_t.

[โ€“] Ephera@lemmy.ml 2 points 2 weeks ago (2 children)

Huh, so if you don't opt for these more specific number types, then your program will explode sooner or later, depending on the architecture it's being run on...?

I guess, times were different back when C got created, with register size still much more in flux. But yeah, from today's perspective, that seems terrifying. ๐Ÿ˜…

The C standard for different ints is absolutely cursed, even after C99 tried to normalize it. The only requirement is that sizeof(char) <= sizeof(short) <= sizeof(int) <= sizeof(long) <= sizeof(long long) and sizeof(char) == 1. Mind you they don't define what size a byte is so you technically can have an architecture where all of those are 64 bits. Oh and for that same reason exact-size types (int32_t, uint16_t etc) are not guaranteed to be defined

Fuck