Re: [commit] Re-implement exceptions.c using a state m/c

Mark Kettenis
2005-01-12T21:20:10Z

Date: Wed, 12 Jan 2005 14:15:52 -0500
From: Andrew Cagney <cagney@gnu.org>

Hello,

This rewrites the throw / catch code to use a state machine and a
linked list of catchers (instead of stack-local variables). There
are no external interface changes.

Hmm, on my i386-unknown-freebsd4.7 system I'm getting:

gcc -c -g -O2 -I. -I../../src/gdb -I../../src/gdb/config -DLOCALEDIR="\"/usr/local/share/locale\"" -DHAVE_CONFIG_H -I../../src/gdb/../include/opcode -I../../src/gdb/../readline/.. -I../bfd -I../../src/gdb/../bfd -I../../src/gdb/../include -I../intl -I../../src/gdb/../intl -DMI_OUT=1 -DTUI=1 -Wimplicit -Wreturn-type -Wcomment -Wtrigraphs -Wformat -Wparentheses -Wpointer-arith -Wuninitialized -Wformat-nonliteral -Werror ../../src/gdb/exceptions.c
cc1: warnings being treated as errors
../../src/gdb/exceptions.c: In function `catch_exceptions_with_msg':
../../src/gdb/exceptions.c:315: warning: variable `val' might be clobbered by `longjmp' or `vfork'
../../src/gdb/exceptions.c: In function `catch_errors':
../../src/gdb/exceptions.c:333: warning: variable `val' might be clobbered by `longjmp' or `vfork'
gmake[1]: *** [exceptions.o] Error 1
gmake[1]: Leaving directory `/home/kettenis/sandbox/gdb/obj/gdb'
gmake: *** [all-gdb] Error 2

This is with gcc 2.95.4. I can't say I blame the compiler for losing
track here; I can't establish for myself whether there's an actual
problem here or not.

Andrew, can you please rwerite the code such that it becomes a bit
easier to follow?

Thanks,

Mark