In article <49a9024b.0e0d6e0a.11f5.ffffee2f / mx.google.com>,
  Nobuyoshi Nakada <nobu / ruby-lang.org> writes:

> I guess you misses a point here, gcc is aware of setjmp() and
> emits code to save and restore registers into the stack before
> and after it.  I suspect it doesn't work enough for some reason.
> Anyway, your way would be correct for other compilers.

gcc -O -W warns it.

% gcc -O2 -g -W -Wall -Wno-parentheses  -DRUBY_EXPORT  -I. -I.    -c eval.c             
eval.c: In function 'rb_disable_super':
eval.c:637: warning: unused parameter 'klass'
eval.c:638: warning: unused parameter 'name'
eval.c: In function 'rb_enable_super':
eval.c:645: warning: unused parameter 'klass'
eval.c:646: warning: unused parameter 'name'
eval.c: In function 'rb_svar':
eval.c:978: warning: comparison between signed and unsigned
eval.c: In function 'ruby_cleanup':
eval.c:1644: warning: comparison between signed and unsigned
eval.c: In function 'ev_const_defined':
nute(18:59:37)% gcc -O2 -g -W -Wall -Wno-parentheses -Wno-unused-parameter -DRUBY_EXPORT  -I. -I.    -c eval.c
eval.c: In function 'rb_svar':
eval.c:978: warning: comparison between signed and unsigned
eval.c: In function 'ruby_cleanup':
eval.c:1644: warning: comparison between signed and unsigned
eval.c: In function 'rb_exec_recursive':
eval.c:13728: warning: variable 'hash' might be clobbered by 'longjmp' or 'vfork'
eval.c: In function 'rb_thread_start_1':
eval.c:12571: warning: variable 'th' might be clobbered by 'longjmp' or 'vfork'
nute(19:02:09)% gcc -O2 -g -W -Wall -Wno-parentheses -Wno-unused-parameter -DRUBY_EXPORT  -I. -I.    -c eval.c
eval.c: In function 'rb_svar':
eval.c:978: warning: comparison between signed and unsigned
eval.c: In function 'ruby_cleanup':
eval.c:1644: warning: comparison between signed and unsigned
eval.c: In function 'rb_exec_recursive':
eval.c:13728: warning: variable 'hash' might be clobbered by 'longjmp' or 'vfork'
eval.c: In function 'rb_thread_start_1':
eval.c:12571: warning: variable 'th' might be clobbered by 'longjmp' or 'vfork'
eval.c: In function 'rb_thread_schedule':
eval.c:11073: warning: variable 'next' might be clobbered by 'longjmp' or 'vfork'
eval.c: In function 'rb_eval':
eval.c:3612: warning: variable 'saved_cref' might be clobbered by 'longjmp' or 'vfork'
eval.c: In function 'rb_yield_0':
eval.c:4981: warning: variable 'var' might be clobbered by 'longjmp' or 'vfork'
eval.c:4990: warning: variable 'lambda' might be clobbered by 'longjmp' or 'vfork'
eval.c:4978: warning: argument 'val' might be clobbered by 'longjmp' or 'vfork'
eval.c:4978: warning: argument 'self' might be clobbered by 'longjmp' or 'vfork'
eval.c: In function 'proc_invoke':
eval.c:8863: warning: argument 'args' might be clobbered by 'longjmp' or 'vfork'
eval.c: In function 'rb_call0':
eval.c:5997: warning: variable 'local_vars' might be clobbered by 'longjmp' or 'vfork'
eval.c:5998: warning: variable 'saved_cref' might be clobbered by 'longjmp' or 'vfork'
eval.c:5875: warning: argument 'argc' might be clobbered by 'longjmp' or 'vfork'
eval.c:5876: warning: argument 'argv' might be clobbered by 'longjmp' or 'vfork'
eval.c: In function 'error_print':
eval.c:1262: warning: variable 'errat' might be clobbered by 'longjmp' or 'vfork'
eval.c:1264: warning: variable 'einfo' might be clobbered by 'longjmp' or 'vfork'
eval.c:1265: warning: variable 'elen' might be clobbered by 'longjmp' or 'vfork'
eval.c: In function 'rb_longjmp':
eval.c:4618: warning: argument 'mesg' might be clobbered by 'longjmp' or 'vfork'
eval.c: In function 'rb_block_pass':
eval.c:9190: warning: argument 'proc' might be clobbered by 'longjmp' or 'vfork'
eval.c: In function 'rb_exec_end_proc':
eval.c:8145: warning: variable 'link' might be clobbered by 'longjmp' or 'vfork'
eval.c: In function 'call_trace_func':
eval.c:2755: warning: variable 'node_save' might be clobbered by 'longjmp' or 'vfork'
eval.c:2751: warning: argument 'klass' might be clobbered by 'longjmp' or 'vfork'
eval.c: In function 'is_defined':
eval.c:2403: warning: argument 'node' might be clobbered by 'longjmp' or 'vfork'
eval.c: In function 'eval':
eval.c:6529: warning: variable 'data' might be clobbered by 'longjmp' or 'vfork'
eval.c:6525: warning: argument 'self' might be clobbered by 'longjmp' or 'vfork'
eval.c:6526: warning: argument 'file' might be clobbered by 'longjmp' or 'vfork'
eval.c:6527: warning: argument 'line' might be clobbered by 'longjmp' or 'vfork'
eval.c: In function 'ruby_cleanup':
eval.c:1615: warning: argument 'ex' might be clobbered by 'longjmp' or 'vfork'
eval.c: In function 'rb_thread_start_0':
eval.c:12441: warning: argument 'th' might be clobbered by 'longjmp' or 'vfork'
-- 
Tanaka Akira