Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

asio::config fails to query integer-based properties (wrong usage of max_digits10) #1587

Open
manipuladordedados opened this issue Jan 16, 2025 · 0 comments

Comments

@manipuladordedados
Copy link

max_digits10 is only meaningful for floating-point types, and, at least on Linux/GCC/libstdc++, expands to 0 on any non-floating-point types. This causes buffers such as

char buf[std::numeric_limits<unsigned long long>::max_digits10 + 1];
to be 0-sized and fail to query the actual value for the desired property.

Code such as the following will always return 0:

asio::config cfg{ioctx}; 
return cfg.get("scheduler", "concurrency_hint", 1); 
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

No branches or pull requests

1 participant