[build failure] clang++ 23 not including <cmath> and <vector> by default
Maintainers usually reply within 5 days
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 84/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- cpp
- Domain
- build-system, compilers
Research direction
Inspect src/api/wayfire/geometry.hpp and src/api/wayfire/signal-provider.hpp, starting with the missing std::floor and std::vector declarations reported by clang++ 23. Add the required standard-library includes if appropriate, then replay the clang++ 23.1.1 build and confirm the affected compilations succeed without regressing the clang++ 22.1.8 build.
Written by the indexing model from the issue text.
Description
Describe the issue
When building with clang++ 23.1.1, two .hpp make the compilations fail:
In file included from ../plugins/common/workspace-wall.cpp:1:
In file included from ../plugins/common/wayfire/plugins/common/workspace-wall.hpp:3:
In file included from ../src/api/wayfire/workspace-set.hpp:4:
../src/api/wayfire/geometry.hpp:66:29: error: no member named 'floor' in namespace 'std'; did you mean simply 'floor'?
66 | return point_t{(int)std::floor(x), (int)std::floor(y)};
| ^~~~~~~~~~
| floor
[…]
In file included from ../plugins/common/move-drag-interface.cpp:1:
In file included from ../plugins/common/wayfire/plugins/common/move-drag-interface.hpp:3:
In file included from ../src/api/wayfire/toplevel-view.hpp:4:
In file included from ../src/api/wayfire/view.hpp:8:
In file included from ../src/api/wayfire/nonstd/tracking-allocator.hpp:7:
../src/api/wayfire/signal-provider.hpp:48:10: error: no template named 'vector' in namespace 'std'
48 | std::vector<provider_t*> connected_to;
| ~~~~~^
Replaying the same exact command with clang++ 23.1.1 replaced by a (similarly installed) clang++ 22.1.8 install passes.
So this is probably clang 23 being stricter in its enforcement of the C++ standard, or having changed its way of compiling (compiling once for all at inclusion of the .hpp, rather than function by function at use in a .cpp?).
Obvious workaround
#include <cmath> and #include <vector> make everything pass.
Now is it the expected way of maintaining include cleanness?
- Dominant language
- C++
- Stars
- 3.1k
- Forks
- 247
- Avg merge
- 8d 11h
- Merged PRs (30d)
- 9
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from WayfireWM/wayfire
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
WayfireWM/wayfire#3148 · 1 comment ·
Maintainers usually reply within 5 days
-
easy enhancement good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
WayfireWM/wayfire#3005 · 14 comments ·
Maintainers usually reply within 5 days
-
Difficulty 3/5 1-2 days Newbie friendliness 67/100
Maintainers usually reply within 5 days
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 55/100
Maintainers usually reply within 5 days
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 53/100
WayfireWM/wayfire#3164 · 2 comments ·
Maintainers usually reply within 5 days
All issues in WayfireWM/wayfire
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
KhronosGroup/Vulkan-Tutorial#534 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 2 days
-
bug IO
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
MrNeRF/LichtFeld-Studio#3824 ·
Maintainers usually reply within 1 day
-
pnnx: manual tanh GELU fusion loses the approximation modePossibly taken @ktz03 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Tencent/ncnn#7175 · 1 reaction ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
throneproj/Throne#2043 ·
Maintainers usually reply within 2 days