$ gcc -Wall -g -lgomp nothread.c ; ./a.out ; echo $?
$ gcc -Wall -g -lgomp thread.c ; ./a.out ; echo $?
$ gdb ./a.out
GNU gdb 6.3.50-20050815 (Apple version gdb-1518) (Sat Feb 12 02:52:12 UTC 2011)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin"...Reading symbols for shared libraries .. done
Starting program: ./a.out
Reading symbols for shared libraries +. done
Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x0000000000000010
[Switching to process 99163 thread 0x417]
0x000000010000180c in gomp_resolve_num_threads ()
#0 0x000000010000180c in gomp_resolve_num_threads ()
#1 0x0000000100002245 in thread_body (data=0x0) at thread.c:7
#2 0x00007fff8667c4f6 in _pthread_start ()
#3 0x00007fff8667c3a9 in thread_start ()