On 14/11/06, Dirk Eddelbuettel <[EMAIL PROTECTED]> wrote:

On 14 November 2006 at 10:55, Jordi Gutierrez Hermoso wrote:
| Package: libgsl0
| version 1.8-1
| severity: wishlist
|
| I'm not sure if this is desirable, but in order to use exceptions in
| GSL from my C++ wrappers, GSL needs to be recompiled with the CFLAG
| -fexceptions.

Very interesting suggestion. I am principally in favour, and have only two
concerns

i)   possible overhead, though the gcc manual seems to imply that it is
     affecting size only, not speed

Checked this. The increase in size is barely noticeable.

ii)  Policy -- I am not sure if Debian has a view on this either way. I may
     bring this up on the Debian-science list.

Page 78 of policy 3.7.2.1 says "It is up to the package maintainer to
decide what compilation options are best for the package." Given that
GSL provides a mechanism for defining a custom error handler, giving a
custom C++ error handler that throws exceptions seems like something
one could reasonably do. Same paragraph in the policy also seems to
suggest that -O3 is ideally suited for GSL.

I attach a patch for debian/rules that adds -fexceptions to CFLAGS and
uses -O3 instead of -O2 optimisation. I tested this with my personal
C++ code which does indeed catch exceptions now. :-)

Would you mind also asking on the GSL list if there is a general
recommendation in favour, against, or neutral?

Neutral, it seems:

---------- Forwarded message ----------
From: Brian Gough <[EMAIL PROTECTED]>
Date: 16-Nov-2006 11:24
Subject: Re: [Help-gsl] Fwd: Bug#398628: GSL has no exception handling
To: Jordi Gutierrez Hermoso <[EMAIL PROTECTED]>
Cc: help-gsl@gnu.org


Jordi Gutierrez Hermoso wrote:
I am forwarding this bug from the Debian Bug Tracking System. Dirk
wants to know if you recommend exceptions or not.

Sorry, I don't really have any arguments one way or the other. As far as
I'm aware there are no problems with -fexceptions apart from the extra
size but I have not made any serious use of it myself.

--
Brian Gough
(GSL Maintainer)

Network Theory Ltd,
Publishing the GSL Manual - http://www.network-theory.co.uk/gsl/manual/
--- rules	2006-11-17 14:59:49.000000000 -0600
+++ rules-new	2006-11-17 15:00:26.000000000 -0600
@@ -38 +38 @@
-	DEBUGFLAGS += -O2
+	DEBUGFLAGS += -O3
@@ -44 +44 @@
-CFLAGS	:=-Wall -pipe -D_REENTRANT $(DEBUGFLAGS)
+CFLAGS	:=-Wall -pipe -fexceptions -D_REENTRANT $(DEBUGFLAGS)

Reply via email to