#188 Broken build when exceptions are disabled


In dev-libs/ferrisloki version 3.0.3 installed from Portage the file Singleton.h doesn't build on EKOPath compiler when exceptions are disabled. In my case it produces the following error:

In file included from /usr/include/FerrisLoki/loki/SmartPtr.h:33:
In file included from /usr/include/FerrisLoki/loki/SmallObj.h:23:
/usr/include/FerrisLoki/loki/Singleton.h:358:11: error: cannot use 'throw' with exceptions disabled
{ throw std::logic_error("Dead Reference Detected"); }

My EKOPath version is:
PathScale EKOPath(tm) Compiler Suite: Version 5.0.0
Built on:
Thread model: posix
GNU gcc compatible version 4.2.1

I would expect any throw in the code to be a macro or to be within an #ifdef.


  • King_DuckZ

    King_DuckZ - 2013-02-05
    • summary: Broken build when excteptions are disabled --> Broken build when exceptions are disabled
  • King_DuckZ

    King_DuckZ - 2013-02-28

    This also happens on gcc, sorry for not testing it earlier:

    /usr/include/FerrisLoki/loki/Functor.h: In static member function ‘static U* Loki::Private::FunctorImplBase<R, ThreadingModel>::Clone(U*)’:
    /usr/include/FerrisLoki/loki/Functor.h:93:17: error: cannot use typeid with -fno-rtti
    /usr/include/FerrisLoki/loki/Functor.h:93:17: error: cannot use typeid with -fno-rtti
    make[2]: *** [DuckLib/DuckUtils/CMakeFiles/DuckUtils.dir/ObjectLoader.cpp.o] Errore 1

  • King_DuckZ

    King_DuckZ - 2013-02-28

    Ok sorry for the previous comment, that's unrelated to this bug. That's what I get for drinking too much coffee and doing things hurriedly.

  • Richard Sposato

    Richard Sposato - 2013-06-18

    Hi King_DuckZ,

    Loki throws exceptions from many places. In some places, the exceptions are part of how Loki works.

    I could modify Loki's source code and header files to put #ifdef's around any throw, try, or catch statements, but that requires a lot of changes throughout the code. Doing so may result in a slimmed down version of Loki with fewer abilities. I will have to think about this one.



  • King_DuckZ

    King_DuckZ - 2013-06-27

    Hello Rich,
    Since when I reported this problem I've switched to using exceptions, for several reasons. I don't personally need this fix anymore, but I'm not sure if other programmers (especially game programmers) might still be interested. Thanks anyways.


Log in to post a comment.