From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Jacobowitz To: gdb-patches@sources.redhat.com Cc: Andrew Cagney Subject: Re: [RFC] sigsetjmp/siglongjmp on cygwin -- problem tracked down Date: Mon, 13 Aug 2001 20:10:00 -0000 Message-id: <20010813201116.A12426@nevyn.them.org> References: <3B785A0C.7000104@cygnus.com> <20010813193225.A10164@redhat.com> <20010813222037.A20589@redhat.com> <3B788F78.8050005@cygnus.com> <20010813225508.A22351@redhat.com> X-SW-Source: 2001-08/msg00160.html On Mon, Aug 13, 2001 at 10:55:08PM -0400, Christopher Faylor wrote: > On Mon, Aug 13, 2001 at 10:39:52PM -0400, Andrew Cagney wrote: > >> So, with the above buggy code, we'll eventually derefernce *catch_return[36] > >> when we should be dereferencing (*catch_return)[36]. > >> > >> I'll fix cygwin. How do we want to fix gdb? > >> > >> I could add a define in setjmp.h like this: > >> > >> #define WORKING_SETJMP 1 > > > > > >The BSD way of doing it was: > > > > #include > > #if BSD >= 199506 > > ... was this from the last bsd release ever ... > > #endf > > > >While it leads to pretty obscure tests (like the above) it did make it > >possible to test for anything constrained to a specific release. > > Doh. Now that you mention it, Cygwin actually already has a mechanism > for this. We bump a minor version number when there are api changes, > such as this. Then we usually define a macro like > "CYGWIN_VERSION_SIGSEJMP_IS_OK" based on the API. It is a little > tricky, though, since the actual header file is in newlib not cygwin. On the other hand, it should be very straightforward to write an autoconf test for this. You said that the code in question looked like env[36] instead of (env)[36]; just use an argument that would not be valid to subscript. env + 1[36], for instance, should generally not compile. -- Daniel Jacobowitz Carnegie Mellon University MontaVista Software Debian GNU/Linux Developer