Results 1 to 5 of 5
Hi , I got a problem about assert() on linux/unix && gcc , I wanna know how does assert() work,I mean that how does the assert() make the programme exit? ...
- 05-22-2010 #1Just Joined!
- Join Date
- Oct 2009
- Posts
- 6
How does the assert() work?
Hi , I got a problem about assert() on linux/unix && gcc , I wanna know how does assert() work,I mean that how does the assert() make the programme exit? Is assert() send SIGSEGV to programme or called function exit() or other ways? Thank you
Last edited by Cabhan; 05-22-2010 at 04:17 PM. Reason: Reducing font size.
- 05-22-2010 #2Debian GNU/Linux -- You know you want it.
- 05-22-2010 #3
The best way to answer this question would be to look at the assert man page. Man pages are a set of documentation built into Linux systems. Run this command from the commandline:
It will explain how assert() works. A short summary is that if the expression is false, an error message is printed and abort() is called. To see what abort is, we check its man page:Code:man 3 assert
We see here that abort() sends the process a SIGABRT.Code:man 3 abort
DISTRO=Arch
Registered Linux User #388732
- 05-24-2010 #4
- 05-24-2010 #5


Reply With Quote
