Closed Bug 205922 Opened 22 years ago Closed 22 years ago

Test for exception declaration in configure.in is wrong

Categories

(SeaMonkey :: Build Config, defect)

All
IRIX
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED INVALID

People

(Reporter: pthomas, Assigned: mozbugs-build)

Details

Funny that no one ever noticed, but this test in configure.in: # Irix & OSF native compilers do not like exception declarations # when exceptions are disabled -if test "$_MOZ_CPP_EXCEPTIONS" -o -n "$MIPSPRO_CXX" -o -n "$COMPAQ_CXX" -o -n "$VACPP"; then AC_DEFINE(CPP_THROW_NEW, []) else AC_DEFINE(CPP_THROW_NEW, [throw()]) Will never do what was intended :) It should look like this: # Irix & OSF native compilers do not like exception declarations # when exceptions are disabled +if test "$_MOZ_CPP_EXCEPTIONS" -a \( -n "$MIPSPRO_CXX" -o -n "$COMPAQ_CXX" -o -n "$VACPP" \); then AC_DEFINE(CPP_THROW_NEW, []) else AC_DEFINE(CPP_THROW_NEW, [throw()]) I'll attatch this as a diff too.
The original test is correct. The extra |throw()| declaration should only be used when --enable-cpp-exceptions is not set and when not using one of the MIPSPro, VACPP or COMPAQ_CPP compilers. See bug 149032.
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → INVALID
No, the test is wrong, as you need the extra throw() declaration exactly when --enable-cpp-exceptions is used, to tell the compiler that a given method/operator does not ever throw an exception. If you omit this and enable exceptions, you get warnings from gcc that either operator new must not throw an exception or you should use -fcheck-new to check at runtime. So the check needs to be (I did get it wrong originally): if test -z "$_MOZ_CPP_EXCEPTIONS" -a \( -n $MIPSPRO_CXX" -o -n \ "$COMPAQ_CXX" -o -n "$VACPP" \); then [....] To accomplish exactly what the comment says: remove the exception declarations if exceptions are disabled and one of the given compilers is used.
Status: RESOLVED → REOPENED
Resolution: INVALID → ---
> No, the test is wrong, as you need the extra throw() declaration exactly when > --enable-cpp-exceptions is used, to tell the compiler that a given method/operator > does not ever throw an exception. Let's ignore the extra compiler checks for a moment. Did you actually read bug 149032? If you had, then you should have seen that the extra throw() is only used when --disable-cpp-exceptions is used in order to catch and drop any exceptions that are thrown by the system when mozilla is compiled without exception support. If the user explicitly enables c++ exception handling, then we expect that they will add the correct handlers to support that since Mozilla does not have any support for exceptions. I'm not sure if your position is that you want to silence the gcc warnings or actually pass exceptions through Mozilla. If it's the former, then you want to open a new bug on disabling exception handling completely (via throw()) even when --enable-cpp-exceptions is used (or reopen bug 149032). If it's the latter, then you're really on your own since the mozilla.org c++ portability guide says that c++ exceptions are not supported. >To accomplish exactly what the comment says: remove the exception declarations if >exceptions are disabled and one of the given compilers is used. Afaik, the comment has never said that. It says: # Irix & OSF native compilers do not like exception declarations # when exceptions are disabled Which means that you cannot use |throw()| when exceptions are disabled for those compilers using some compiler specific flag. And currently, we do not want to use |throw()| when exceptions are enabled for any compiler so the current test is correct.
Status: REOPENED → RESOLVED
Closed: 22 years ago22 years ago
Resolution: --- → INVALID
not a Mac OS 8 issue.
OS: Mac System 8.0 → IRIX
Product: Browser → Seamonkey
You need to log in before you can comment on or make changes to this bug.