Re: [xml] -fexceptions

On Thu, Apr 03, 2003 at 07:21:29PM +0100, Graham Bennett wrote:

Is there an easy way to enable the -fexceptions flag for gcc when
building libxml?  If not, I think it would be worth adding to the
configure script (e.g. --with-exceptions).  It would be very useful to
be able to throw from SAX callbacks when using libxml from C++.

  Okay, I did look at this. I did some checks:

Compiled with -O2
gnome:~/XML -> ls -l .libs/libxml2.a .libs/
-rw-rw-r--    1 veillard www       1136512 Jul 27 09:02 .libs/libxml2.a
-rwxrwxr-x    1 veillard www       1056727 Jul 27 09:02 .libs/*
gnome:~/XML -> ./xmllint --timing --stream db100000.xml
Parsing took 14399 ms
gnome:~/XML ->

Compiled with -O2 -fexceptions
gnome:~/XML -> ls -l .libs/libxml2.a .libs/
-rw-rw-r--    1 veillard www       1216584 Jul 27 09:15 .libs/libxml2.a
-rwxrwxr-x    1 veillard www       1171039 Jul 27 09:15 .libs/*
gnome:~/XML -> ./xmllint --timing --stream db100000.xml
Parsing took 14334 ms
gnome:~/XML ->

  I'm afraid that taking a 10+% hit on code size is a bit hard to justify
so I simply added this as an option to configure:

gnome:~/XML -> ./configure --help | grep exception
  --with-fexceptions      add GCC flag -fexceptions for C++ exceptions (off)
gnome:~/XML ->

  which is kept off by default. I hope it's sufficient. It's in CVS now,


Daniel Veillard      | Red Hat Network
veillard redhat com  | libxml GNOME XML XSLT toolkit | Rpmfind RPM search engine

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]