[PPL-devel] Re: Feature request: optionally compile with support for exceptions

Niels Möller nisse at lysator.liu.se
Tue Oct 23 12:20:11 CEST 2001


Roberto Bagnara <bagnara at cs.unipr.it> writes:

> what I am asking for is a feature and I am willing to do everything it
> requires to minimize the chance of troubles.  That is why I sent a
> message to this list.  The feature is very important for our
> application (a C++ library for the manipulation of convex polyhedra)
> and I believe it is important for all those C++ applications where the
> exhaustion of virtual memory cannot simply be handled by writing a
> message and aborting.  The feature is so important that I have already
> done the modifications I am proposing to GMP 3.1.1.  What I would like
> to avoid is having to distribute tar archives and RPMs of the modified
> version to the users of our library.

Thanks for the background. Also please note that I'm not making any
decisions, I'm just a member of the gmp mailing list.

> I realize that there is a potential for troubles but I also believe
> that solutions can be found.  For the people doing `make install' we
> could make sure the exceptions-enabled versions of GMP are installed
> under the basename, say `libgmp_e'.

That would help. 

> No, CXXFLAGS has nothing to do with what we are talking about.
> In fact
> 
> 1) GMP is written in C;
> 2) -fexceptions is the GCC default for the compilation of C++ sources,
>    so it will be OK even when GMP will include the new C++ interface.

My intention was to add the -fexceptions flag to the flags used when
compiling GMP:s C++ wrapper (which isn't included in the dist yet),
but not when compiling the C and assembler files.

Are you saying that one has to use -fexceptions also when compiling
the files that are written in C? That's news to me, but I'm mostly
ignorant when it comes to C++ exceptions.

> >  CXXFLAGS=-fexceptions && ./configure && make

> Perhaps you meant
> 
>    CFLAGS=-fexceptions && ./configure && make
> 
> but this is also a very bad idea in GMP 3.1.1 (the current release),
> since `-fexceptions' will _replace_ any other compilation option so
> that a good portion of the nice work done by the configure script
> is simply lost.  In other words, on the machine I am using this very
> moment, I would compile GMP with `-fexceptions' instead of
> `-g -O -fomit-frame-pointer -mcpu=pentiumpro', and these

Sorry for the typo. I meant

  CXXFLAGS=-fexceptions ./configure && make

I.e. CXXFLAGS should be set in _configure's_ environment, but not in
_make's_. If that doesn't work, it could be considered a bug in the
configure script.

/Niels



More information about the PPL-devel mailing list