Earlier quoted context omitted.
Most of the code in glibc has been heavily Dreppered.
What does Dreppered mean?
Every programmer should read the source to abort() at some point in their life.
21–30 of 61 posts
Re: Every programmer should read the source to abort() at some point in their life.
#22Re: Every programmer should read the source to abort() at some point in their life.
#23Why is the outer while(1) loop needed? Seems redundant to me.
The link specifically asks that question -- there are some good guesses in the comments.
Re: Every programmer should read the source to abort() at some point in their life.
#24Re: Every programmer should read the source to abort() at some point in their life.
#25Earlier quoted context omitted.
The link specifically asks that question -- there are some good guesses in the comments.
the one in line 87. It looks like it might be added later because it's not even indented, but clearly it doesn't serve any purpose and it doesn't make it more readable (you can tell the function never returns from the second while(1) loop).
It's an issue of mixed tab-space indentation, with tabs being displayed at 4 spaces instead of the 8 spaces they were intended to be.
Re: Every programmer should read the source to abort() at some point in their life.
#26For comparison, here's FreeBSD's abort(): http://svnweb.freebsd.org/base/head/lib/libc/stdlib/abort.c?... And GNU glibc's abort(): http://sourceware.org/git/?p=glibc.git;a=blob_plain;f=stdlib...
* Writing to NULL
* Writing to address 1 (unaligned write)
* Writing to text space (read-only machine code)
* Dividing by 0
* More violence than SIGABRT (SIGILL, SIGBUS)
http://www.opensource.apple.com/source/Libc/Libc-262/stdlib/...
Re: Every programmer should read the source to abort() at some point in their life.
#27Plan 9's abort causes an access fault, causing the current process to enter the `Broken' state. The process can then be inspected by a debugger. Pretty elegant. http://plan9.bell-labs.com/sources/plan9/sys/src/libc/9sys/a...
again, what's with the while()? even if it doesnt cause a segmentation fault, there's a chance it will evaluate to 0.
On a more prosaic note, perhaps
for(;;)
*(int *)0;
generates a compiler warning that the programmer wanted to avoid.Re: Every programmer should read the source to abort() at some point in their life.
#28For comparison, here's FreeBSD's abort(): http://svnweb.freebsd.org/base/head/lib/libc/stdlib/abort.c?... And GNU glibc's abort(): http://sourceware.org/git/?p=glibc.git;a=blob_plain;f=stdlib...
And OSX's, which is rather similar to FreeBSD's but adds: * Writing to NULL * Writing to address 1 (unaligned write) * Writing to text space (read-only machine code) * Dividing by 0 * More violence than SIGABRT (SIGILL, SIGBUS) http://www.opensource.apple.com/source/Libc/Libc-262/stdlib/...
Re: Every programmer should read the source to abort() at some point in their life.
#29Re: Every programmer should read the source to abort() at some point in their life.
#30Plan 9's abort causes an access fault, causing the current process to enter the `Broken' state. The process can then be inspected by a debugger. Pretty elegant. http://plan9.bell-labs.com/sources/plan9/sys/src/libc/9sys/a...
again, what's with the while()? even if it doesnt cause a segmentation fault, there's a chance it will evaluate to 0.