Menu

Android NDK with -fno-exceptions

2021-10-20
2021-10-21
  • Pixelblender

    Pixelblender - 2021-10-20

    Hi,

    Sorry to bother you again. This time it's Android Studio.

    Compiling using Android Studio with ndk 22.1.7171670 or 23.1.7779620 will throw error:
    half.hpp:4576:4: error: cannot use 'throw' with exceptions disabled

    Setting the flag -DHALF_ERRHANDLING_FLAGS=0 doesn't help. Did I miss anything?

    Thank you for your time!

    Best Regards,

     
    • Christian Rau

      Christian Rau - 2021-10-20

      Hello,

      That wouldn't be the HALF_ERRHANDLING_FLAGS macro, rather than the
      HALF_ERRHANDLING_THROW_... macros, as explained in the documentation on
      http://half.sourceforge.net/. However, all the automatic error handling
      features already are disabled by default, so this won't help you. Your
      problem likely is the function fethrowexcept, which also works without
      automatic error handling and contains throw statements.

      Unfortunately it seems there really is no other way around it than for you
      to manually comment out or remove these throw statements from the function
      in your local version of the half.hpp file. Exception handling has been a
      standard C++ feature for decades and I can't really add options for
      disabling it just because some exotic platforms decide they don't properly
      support standard C++.

      Regards,
      Christian Rau

      Am Mi., 20. Okt. 2021 um 07:52 Uhr schrieb Pixelblender pixelblender3d@users.sourceforge.net:

      Hi,

      Sorry to bother you again. This time it's Android Studio.

      Compiling using Android Studio with ndk 22.1.7171670 or 23.1.7779620 will
      throw error:
      half.hpp:4576:4: error: cannot use 'throw' with exceptions disabled

      Setting the flag -DHALF_ERRHANDLING_FLAGS=0 doesn't help. Did I miss
      anything?

      Thank you for your time!

      Best Regards,


      Android NDK with -fno-exceptions


      Sent from sourceforge.net because you indicated interest in <
      https://sourceforge.net/p/half/discussion/general/>

      To unsubscribe from further messages, please visit <
      https://sourceforge.net/auth/subscriptions/>

       
      • Pixelblender

        Pixelblender - 2021-10-21

        Hi,

        Thank you for your reply. Turns out using clang-12 on linux with -fno-exceptions produce similar error. AFAIK Android NDK is using clang for their compiler.

        on my machine clang --version says:
        Ubuntu clang version 12.0.0-3ubuntu1~20.04.3

        Thank you for your time.

        Best Regards,

         

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.