FC 12 GCC question!

how to disable the "Segmentation fault"  function of GCC compiler?

um... segfault is usually a programming error in your code. it happens when the program tries to access memory in a location that it has no right to do so, then the OS will send a segmentation fault signal to the process and kill it

TOP

um... segfault is usually a programming error in your code. it happens when the program tries to acc ...
icarus-c 發表於 2010-4-28 17:45

咁有冇得唔要呢個功能呀??, 我依家就係想整走呢個功能!

TOP

No.
as stated, it is caused by programming error but not compiler feature.
segmentation fault is issued by OS with memory protection
(Prove me wrong)

TOP

如果個程式正常運作係唔會有 seg fault 嘅。
基本上一定係你寫/抄嘅 code 有問題先會咁。

TOP

咁有冇得唔要呢個功能呀??, 我依家就係想整走呢個功能!
vladdraculz 發表於 2010-4-28 19:19


你個 program crash 左... disable 喱個 error 嘅方法就係 de 晒啲 bug :funk:

TOP

本帖最後由 vladdraculz 於 2010-4-29 02:17 編輯

del

TOP

其實你想點啫?

回復 7# vladdraculz

TOP

Segmentation Fault is NOT a function of GCC!  Your OS kills your program, because your program tried to access some memory not belonging to you, or your program tried to jump to a random location.  So, you won't be able to disable Segmentation Fault.  (Or, don't use a CPU with MMU, say, on those 8-bit MCU!)

Your question can make a big gag in programmers circle!  Thank you for your humor!

Stephen Wong @ Hong Kong

TOP