-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Fix missing includes in fmt.cc #3994
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR.
This causes duplicated std definitions in the fmt module
Thank you! |
|
@yujincheng08, what warnings do you get? |
@vitaut The warnings are: [10/14] /usr/bin/clang++-18 -DFMT_MODULE -Ifmt/include -O3 -DNDEBUG -std=gnu++20 -fvisibility=hidden -fvisibility-inlines-hidden -MD -MT CMakeFiles/fmt.dir/src/fmt.cc.o -MF CMakeFiles/fmt.dir/src/fmt.cc.o.d @CMakeFiles/fmt.dir/src/fmt.cc.o.modmap -o CMakeFiles/fmt.dir/src/fmt.cc.o -c fmt/src/fmt.cc
In file included from fmt/src/fmt.cc:102:
In file included from fmt/include/fmt/args.h:17:
fmt/include/fmt/format.h:42:12: warning: '#include <filename>' attaches the declarations to the named module 'fmt', which is not usually intended; consider moving that directive before the module declaration [-Winclude-angled-in-module-purview]
42 | # include <cmath> // std::signbit
| ^
fmt/include/fmt/format.h:44:12: warning: '#include <filename>' attaches the declarations to the named module 'fmt', which is not usually intended; consider moving that directive before the module declaration [-Winclude-angled-in-module-purview]
44 | # include <cstring> // std::memcpy
| ^
In file included from fmt/src/fmt.cc:103:
fmt/include/fmt/chrono.h:14:12: warning: '#include <filename>' attaches the declarations to the named module 'fmt', which is not usually intended; consider moving that directive before the module declaration [-Winclude-angled-in-module-purview]
14 | # include <cmath> // std::isfinite
| ^
fmt/include/fmt/chrono.h:15:12: warning: '#include <filename>' attaches the declarations to the named module 'fmt', which is not usually intended; consider moving that directive before the module declaration [-Winclude-angled-in-module-purview]
15 | # include <cstring> // std::memcpy
| ^
fmt/include/fmt/chrono.h:16:12: warning: '#include <filename>' attaches the declarations to the named module 'fmt', which is not usually intended; consider moving that directive before the module declaration [-Winclude-angled-in-module-purview]
16 | # include <ctime>
| ^
In file included from fmt/src/fmt.cc:108:
fmt/include/fmt/os.h:11:10: warning: '#include <filename>' attaches the declarations to the named module 'fmt', which is not usually intended; consider moving that directive before the module declaration [-Winclude-angled-in-module-purview]
11 | #include <cerrno>
| ^
fmt/include/fmt/os.h:14:12: warning: '#include <filename>' attaches the declarations to the named module 'fmt', which is not usually intended; consider moving that directive before the module declaration [-Winclude-angled-in-module-purview]
14 | # include <cstdio>
| ^
In file included from fmt/src/fmt.cc:113:
fmt/include/fmt/std.h:13:12: warning: '#include <filename>' attaches the declarations to the named module 'fmt', which is not usually intended; consider moving that directive before the module declaration [-Winclude-angled-in-module-purview]
13 | # include <bitset>
| ^
fmt/include/fmt/std.h:15:12: warning: '#include <filename>' attaches the declarations to the named module 'fmt', which is not usually intended; consider moving that directive before the module declaration [-Winclude-angled-in-module-purview]
15 | # include <cstdlib>
| ^
In file included from fmt/src/fmt.cc:114:
fmt/include/fmt/xchar.h:12:12: warning: '#include <filename>' attaches the declarations to the named module 'fmt', which is not usually intended; consider moving that directive before the module declaration [-Winclude-angled-in-module-purview]
12 | # include <cwchar>
| ^
In file included from fmt/src/fmt.cc:125:
In file included from fmt/src/format.cc:8:
fmt/include/fmt/format-inl.h:13:12: warning: '#include <filename>' attaches the declarations to the named module 'fmt', which is not usually intended; consider moving that directive before the module declaration [-Winclude-angled-in-module-purview]
13 | # include <cmath>
| ^
fmt/include/fmt/format-inl.h:16:10: warning: '#include <filename>' attaches the declarations to the named module 'fmt', which is not usually intended; consider moving that directive before the module declaration [-Winclude-angled-in-module-purview]
16 | #include <cerrno> // errno
| ^
fmt/include/fmt/format-inl.h:17:10: warning: '#include <filename>' attaches the declarations to the named module 'fmt', which is not usually intended; consider moving that directive before the module declaration [-Winclude-angled-in-module-purview]
17 | #include <climits>
| ^
In file included from fmt/src/fmt.cc:127:
fmt/src/os.cc:15:10: warning: '#include <filename>' attaches the declarations to the named module 'fmt', which is not usually intended; consider moving that directive before the module declaration [-Winclude-angled-in-module-purview]
15 | #include <climits>
| ^
14 warnings generated. |
This causes duplicated std definitions in the fmt module, e.g.,
ld.lld: error: undefined symbol: std::_LIBCPP_ABI_NAMESPACE::source_location@fmt::file_name[abi:v170000]() const