602
no cap (lemmy.ml)
submitted 1 year ago by gpw@lemmy.ml to c/programmerhumor@lemmy.ml
you are viewing a single comment's thread
view the rest of the comments
[-] grue@lemmy.ml 5 points 1 year ago

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.

[-] bronzle@lemm.ee 5 points 1 year 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

this post was submitted on 25 Aug 2023
602 points (94.8% liked)

Programmer Humor

32558 readers
614 users here now

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

Rules:

founded 5 years ago
MODERATORS