-
Notifications
You must be signed in to change notification settings - Fork 10.4k
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
compilation error with gcc 13.1 #33634
Comments
I met the same issue on Linux. It can be worked around by moving the code to the member-initializer. index 5d287f8c7f..f2263eff2c 100644
--- a/src/core/lib/gprpp/per_cpu.h
+++ b/src/core/lib/gprpp/per_cpu.h
@@ -56,7 +56,7 @@ class PerCpu {
public:
// Options are not defaulted to try and force consideration of what the
// options specify.
- explicit PerCpu(PerCpuOptions options) : cpus_(options.Shards()) {}
+ explicit PerCpu(PerCpuOptions options) : cpus_(options.Shards()), data_{new T[cpus_]} {}
T& this_cpu() { return data_[ExecCtx::Get()->starting_cpu() % cpus_]; }
@@ -67,7 +67,7 @@ class PerCpu {
private:
const size_t cpus_;
- std::unique_ptr<T[]> data_{new T[cpus_]};
+ std::unique_ptr<T[]> data_;
};
} // namespace grpc_core |
I built GCC from git 1e6a948cd22f2f142cdc828296f78c7af9e283c8 and found the issue is also fixed. |
https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=0a2c771910e888c9a26db319122230144789b9bf is the commit that fix the issue. |
This indeed resolve the file compilation, thank you ! But then, there is another problem with protobuf linking, did you have the same issue ?
|
This seems like a compiler bug and environment issue. |
I have the same problem with gcc 12.2.1. Exact version is "12.2.1_p20230428-r1 p2", from gentoo. |
What version of gRPC and what language are you using?
v1.56.0
What operating system (Linux, Windows,...) and version?
Windows 10, cmake 3.26.4, ninja, ccache, lld
What runtime / compiler are you using (e.g. python version or version of gcc)
compiler from : winlibs-x86_64-posix-seh-gcc-13.1.0-llvm-16.0.5-mingw-w64msvcrt-11.0.0-r5
-- The CXX compiler identification is GNU 13.1.0
What did you do?
Please provide either 1) A unit test for reproducing the bug or 2) Specific steps for us to follow to reproduce the bug. If there’s not enough information to debug the problem, gRPC team may close the issue at their discretion. You’re welcome to re-open the issue once you have a reproduction.
In a powershell script :
What did you expect to see?
correct compilation
What did you see instead?
Anything else we should know about your project / environment?
With GCC 12.3 it's ok, should I send a report to gcc or you can fix it yourself ?
The text was updated successfully, but these errors were encountered: