[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: -make native exceptions test
From: |
Nicola Pero |
Subject: |
Re: -make native exceptions test |
Date: |
Thu, 24 Feb 2011 13:54:04 +0000 |
I agree that this all needs fixing. I haven't had time to look at any
of the configure stuff yet. I will before
release, ie in the next week or so.
At a quick look at this, the comments in gnustep-make's configure.ac
seem to clarify that the check for the
version of GCC was added as a quick hack - the actual check required
is the one for the uncaught exception
handler --
# What we want to do: set USE_OBJC_EXCEPTIONS to yes if we can
compile
# something with @try/@catch/@finally/@synchronized in it, and it is
# recent enough (GCC >= 4.4.0) as to be shipped with a working
uncaught
# exception handler.
If we move the proper check for the uncaught exception handler from -
base to -make, then the explicit check
for the version of GCC should go away. I agree with you that that
sounds like the right thing to do. :-)
And, it's certainly better to have tests that test whether things work
or not, as opposed to relying on built-in
knowledge/enumerations of which compiler/runtime supports what (as
these lists tend to easily go out of date
when new releases of compilers, runtimes or such like appear). I
totally agree with you on this.
You can wait for me to do that reorganization, or if you want to do
it, you could just do it yourself - I'm happy
for you to make these changes to gnustep-make (just please avoid
inflammatory comments in the source code).
Thanks
On 24 Feb 2011, at 11:54, David Chisnall wrote:
I'm trying to figure out the native exceptions test in -make, since
it's wrong and needs fixing before the next release, but I'm
hesitant to touch it because I can't work out what it's actually
trying to do. The correct behaviour should be:
- Test whether the exception syntax works
- Test whether we have an uncaught exception handler
- Enable native exceptions if both are true, or native exception
support was explicitly disabled by the user (in which case we can
skip the tests).
What it seems to do:
- Check we're using GCC, disable exceptions if we aren't (no idea
why this test is here)
- Check whether the exception syntax works
- Check whether the compiler (not runtime) version is 4.4 or
greater, and assume that this means that the uncaught exception
handler won't work.
This breaks if:
- You are using the NeXT runtime (supports native exceptions, but
the runtime isn't checked, only the compiler)
- You are using the GNUstep runtime (supports native exceptions)
- You are using a recent GCC runtime with an old compiler
- You are using clang (detected as GCC 4.2), but with a recent(ish)
runtime
Basically, this complex test only actually works if you are using
gcc 4.4 or later, and so could be replaced by a much simpler (though
equally wrong) test for gcc 4.4 or later.
The thing that is confusing me, is that we have a test in -base for
an uncaught exception handler, which tests the thing that we
actually want to test (i.e. can we handle uncaught exceptions),
rather than something vaguely related (are we using GCC 4.4 or
later). Why are we not using this in -make?
David
-- Sent from my STANTEC-ZEBRA
_______________________________________________
Gnustep-dev mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/gnustep-dev