... SIGPIPE signal handler by GCC standard should be SIG_DFL, but codeblocks doesn't respect that standard...
Can you provide a quote from the standard where it is specified that the signal handlers should have been reset to defaults after a fork/exec? From the info given up to now I can only conclude that they are inherited from the parent process and so they have random state after fork/exec. So if your program has some expectations, it should use the specific system calls to set them up.
There is no specific line saying that fork or exec should reset/inherit any signal handling
Anywya i'm not using any of these in the code
As provided, gnu gcc standard states
The default action for all of them is to cause the process to terminate.
on
https://www.gnu.org/software/libc/manual/html_node/Operation-Error-Signals.htmlIn your opinion, there is no reason taht codeblocks would do anything to change signal handlers. But Why is this problem only occuring when I use codeblocks? As I said, I tried it on commandline with
the same code and the signal handler was on SIG_DFL not SIG_IGN
My program shouldn't have to fiddle with signal handlers if the compiler specify a default behaviour.
If you looked on my stackoverflow post, you'll see the code and that i don't change anything on signal handlers.