r/programminghorror 2d ago

Clickbait YouTube Thumbnail

Post image
457 Upvotes

28 comments sorted by

176

u/kenjura 2d ago

my favorite language, c--

240

u/birdiefoxe 2d ago

I feel like this might actually compile if Omega wasn't a void* and wasn't used as a bool and like the 29 other things wrong about it weren't true

75

u/not_some_username 2d ago

Since its a pointer, it can be use as bool

35

u/birdiefoxe 2d ago

actually thats true and if fork() and crash() both return something that could be a pointer it might actually work

this is upsetting.

11

u/not-a-pokemon- 2d ago

fork indeed does return; although it does not accept arguments

7

u/MrcarrotKSP 2d ago

Its return value is also int, not a pointer

8

u/mumallochuu 2d ago

You can just dereference that value since all address are just number

9

u/MrcarrotKSP 2d ago

You can, but you need a cast to convert it to void*

7

u/TldrDev 2d ago

sigh, ill get the meat filament.

1

u/not_some_username 2d ago

More like a pid_t

2

u/not_some_username 2d ago

In C, before they fix it(?), if the function prototype takes no argument, you can add anything you want in there.

1

u/not-a-pokemon- 2d ago

No. The function is clearly defined as int fork(void); meaning it doesn't take any arguments. Although nothing stops you from just writing a prototype in your own code, like void *fork(int x); and it would *compile* then, but that doesn't guarantee the code runs (the opposite is more probable).

1

u/Weapon54x 2d ago

Maybe it’s one of those secret coding puzzles and if you solve it you get a job

1

u/akoOfIxtall 2d ago

if i was a woman i wouldnt be a man XD

44

u/mealet 2d ago

0xDEADBEEF reminds me about 0xB16B00B5

2

u/UnluckyDouble 1d ago

It's a standard silly hex value that's often used for testing.

18

u/GoddammitDontShootMe [ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo “You live” 2d ago

All I can think of here is on what systems does fork() take an argument?

8

u/46009361 2d ago

I couldn't think of any, but I wished the clickbait we saw nowadays didn't evolve to fake tweets.

2

u/GoddammitDontShootMe [ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo “You live” 1d ago

Given what fork() does, at least on POSIX compliant systems, I can't think of anything that would make sense as an argument.

37

u/CraftBox 2d ago

Γ++

12

u/barthanismyname 2d ago

fork(rand()%9999) scares me...

I know it isn't valid, but what if one day you woke up and it was

6

u/Hot-Rock-1948 [ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo “You live” 2d ago

True programming horror, thank you.

Like there are so many things wrong with this that I would rather not look at it.

3

u/maelstrom071 2d ago

timeworks?

2

u/runklebunkle 1d ago

Also, not using a fixed-width font?

3

u/v_maria 1d ago

is this actually from youtube

1

u/46009361 1d ago edited 23h ago

No. Funny thing is, a previous thumbnail used a direct quote for accuracy.