457
submitted 6 months ago by yogthos@lemmy.ml to c/programmerhumor@lemmy.ml
you are viewing a single comment's thread
view the rest of the comments
[-] flashgnash@lemm.ee 5 points 6 months ago

I am spoiled by dotnet and rust error messages. They tell you exactly what the problem is, where it is, and in rust's case sometimes even how to fix it

Then there's C with "segmentation fault"

[-] uis@lemm.ee 3 points 6 months ago* (last edited 6 months ago)

and in rust's case sometimes even how to fix it

Then there's C with "segmentation fault"

  1. You are comparing compiler-generated errors and runtime errors
  2. Rust can trigger segmentation fault and bus error too.
  3. GCC's error messages are very detailed, sometimes can contain suggested solutions.

For example if I will try to compile helloworld without including stdio.h, gcc will warn implicit declaration of function ‘printf’(by default, almost everyone make it error with -Werror=) and will suggest note: include ‘<stdio.h>’ or provide a declaration of ‘printf’. And runtime error reports are as good as programmer makes them, no matter language program was written in.

I am spoiled by core dumps(although rust technically has them too).

Also in context of kernel, it will print stack trace and (if used) will kexec into another kernel that can make core dump or continue working.

[-] flashgnash@lemm.ee 1 points 6 months ago

I do not code in C it was just a throwaway meme lol

[-] onlinepersona@programming.dev 2 points 6 months ago* (last edited 6 months ago)

Then there’s C with “segmentation fault”

Successfully triggered a sea fan. (not me, another dude in the comments)

Anti Commercial-AI license

this post was submitted on 26 Apr 2024
457 points (96.7% liked)

Programmer Humor

32501 readers
505 users here now

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

Rules:

founded 5 years ago
MODERATORS