Skip to content

2091 compilation failed with fno exception#2092

Open
BartolomeyKant wants to merge 6 commits into
NVIDIA:mainfrom
aethernetio:2091-compilation-failed-with-fno-exception
Open

2091 compilation failed with fno exception#2092
BartolomeyKant wants to merge 6 commits into
NVIDIA:mainfrom
aethernetio:2091-compilation-failed-with-fno-exception

Conversation

@BartolomeyKant
Copy link
Copy Markdown
Contributor

solves #2091

@copy-pr-bot
Copy link
Copy Markdown

copy-pr-bot Bot commented May 22, 2026

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

Copy link
Copy Markdown
Contributor

@ispeters ispeters left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't actually have any authority here, but I'd prefer to see the changes made slightly narrower.

Comment thread test/exec/test_function.cpp Outdated
@ericniebler
Copy link
Copy Markdown
Collaborator

/ok to test 3f26d49

@BartolomeyKant
Copy link
Copy Markdown
Contributor Author

There is problems form Catch I forgot about. In local build I just remove Werror temporally.

/home/coder/stdexec/build/_deps/catch2-src/src/catch2/../catch2/catch_translate_exception.hpp:32:73: warning: unused parameter 'it' [-Wunused-parameter]
   32 |             std::string translate( ExceptionTranslators::const_iterator it, ExceptionTranslators::const_iterator itEnd ) const override {
      |                                                                         ^
/home/coder/stdexec/build/_deps/catch2-src/src/catch2/../catch2/catch_translate_exception.hpp:32:114: warning: unused parameter 'itEnd' [-Wunused-parameter]
   32 |             std::string translate( ExceptionTranslators::const_iterator it, ExceptionTranslators::const_iterator itEnd ) const override {
      |                                                                                                                  ^
2 warnings generated.

@BartolomeyKant BartolomeyKant force-pushed the 2091-compilation-failed-with-fno-exception branch from 3f26d49 to 308401b Compare May 25, 2026 13:18
#include <stdexec/__detail/__config.hpp>

/**
* This is a boost::throw_exception implementation provided for fno-exceptions builds
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if it's a right way or not.

The problem is - there is no implementation for boost::throw_exception is case of -fno-exceptions which is used in boost::thread_pool.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rather than adding a boost::throw_exception function, you can use the STDEXEC_THROW macro.

Copy link
Copy Markdown
Contributor Author

@BartolomeyKant BartolomeyKant May 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can use the STDEXEC_THROW macro.

I don't get it.
Can you provide a code snippet?

The problem comes from third-party library, from boost::thread_pool constructor.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, i misunderstood the problem. i'll take a look when i get a sec.

@BartolomeyKant
Copy link
Copy Markdown
Contributor Author

There is problems form Catch I forgot about. In local build I just remove Werror temporally.

/home/coder/stdexec/build/_deps/catch2-src/src/catch2/../catch2/catch_translate_exception.hpp:32:73: warning: unused parameter 'it' [-Wunused-parameter]
   32 |             std::string translate( ExceptionTranslators::const_iterator it, ExceptionTranslators::const_iterator itEnd ) const override {
      |                                                                         ^
/home/coder/stdexec/build/_deps/catch2-src/src/catch2/../catch2/catch_translate_exception.hpp:32:114: warning: unused parameter 'itEnd' [-Wunused-parameter]
   32 |             std::string translate( ExceptionTranslators::const_iterator it, ExceptionTranslators::const_iterator itEnd ) const override {
      |                                                                                                                  ^
2 warnings generated.

catchorg/Catch2#3114

Can we suppress this warning for catch2?

{
exec::function<ex::sender_tag(),
ex::completion_signatures<ex::set_value_t(), ex::set_error_t(int)>>
sndr([]() noexcept { return ex::just_error(42); });
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This error doesn't require exceptions, so it could be included in a -fno-exceptions build, too.

#include <stdexec/__detail/__config.hpp>

/**
* This is a boost::throw_exception implementation provided for fno-exceptions builds
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rather than adding a boost::throw_exception function, you can use the STDEXEC_THROW macro.

@ericniebler
Copy link
Copy Markdown
Collaborator

/ok to test 308401b

@BartolomeyKant BartolomeyKant force-pushed the 2091-compilation-failed-with-fno-exception branch from 308401b to b5423b6 Compare May 27, 2026 06:40
@BartolomeyKant BartolomeyKant force-pushed the 2091-compilation-failed-with-fno-exception branch from b5423b6 to 18f74d0 Compare May 27, 2026 06:42
@ericniebler ericniebler dismissed their stale review May 27, 2026 15:41

my requested change was based on a faulty understanding of the problem.

@ericniebler
Copy link
Copy Markdown
Collaborator

/ok to test 18f74d0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants