this post was submitted on 25 Aug 2023
570 points (95.1% liked)

Programmer Humor

31214 readers
104 users here now

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

Rules:

founded 4 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 22 points 10 months ago* (last edited 10 months ago) (3 children)

Does it make me a bad person that I like this?

Edit: wait.. return ! 0 ; wtf

Edit 2: idc still like it frfr no cap

[–] [email protected] 5 points 10 months ago (1 children)

Edit: wait… return ! 0 ; wtf

I mean, returning non-zero exit status on error is just good practice. It even managed to evaluate to the same numerical value as EXIT_FAILURE when I tested it on my machine (gcc 11.4.0 linux x86-64), although I'm not sure if that's always the case or if it's undefined behavior.

This cursed code is quite well-written.

[–] [email protected] 4 points 10 months ago

!0 is defined as 1, that’s how argv [ no cap ] works, that and the ridiculous argc check stood out as a bit off, but works

load more comments (1 replies)