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

[Bug] 0.17.0 fails with GCC14 with: error: control reaches end of non-void function [-Werror=return-type] #17459

Open
ggardet opened this issue Oct 10, 2024 · 1 comment
Labels
needs-triage PRs or issues that need to be investigated by maintainers to find the right assignees to address it type: bug

Comments

@ggardet
Copy link
Contributor

ggardet commented Oct 10, 2024

0.17.0 fails with GCC14 (on openSSUE Tumbleweed) with: error: control reaches end of non-void function [-Werror=return-type]

Expected behavior

Build should succeed with GCC14.

Actual behavior

Build fails with:

[  247s] /home/abuild/rpmbuild/BUILD/tvm-0.17.0/src/meta_schedule/cost_model/../../support/base64.h: In member function ‘virtual size_t tvm::support::Base64OutStream::Read(void*, size_t)’:
[  247s] /home/abuild/rpmbuild/BUILD/tvm-0.17.0/src/meta_schedule/cost_model/../../support/base64.h:253:19: error: control reaches end of non-void function [-Werror=return-type]
[  247s]   253 |     LOG(FATAL) << "Base64OutStream do not support read";
[  247s]       |                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[  247s] cc1plus: some warnings being treated as errors
[  247s] make[2]: *** [CMakeFiles/tvm_objs.dir/build.make:989: CMakeFiles/tvm_objs.dir/src/meta_schedule/cost_model/cost_model.cc.o] Error 1

Environment

openSUSE Tumbleweed
TVM 0.17.0

Steps to reproduce

Try to build with GCC14.

Triage

Please refer to the list of label tags here to find the relevant tags and add them below in a bullet format (example below).

  • needs-triage
@ggardet ggardet added needs-triage PRs or issues that need to be investigated by maintainers to find the right assignees to address it type: bug labels Oct 10, 2024
@ggardet
Copy link
Contributor Author

ggardet commented Oct 10, 2024

If I add -Wno-error=return-type as workaround, I get the following errors:

[   50s] [  2%] Building CXX object CMakeFiles/tvm_runtime_objs.dir/src/runtime/disco/disco_worker.cc.o
[   50s] /usr/bin/c++ -DDMLC_USE_FOPEN64=0 -DDMLC_USE_LOGGING_LIBRARY="<tvm/runtime/logging.h>" -DNDEBUG -DNDEBUG=1 -DTVM_ENABLE_SPIRV=1 -DTVM_INDEX_DEFAULT_I64=1 -DTVM_LLVM_HAS_AARCH64_TARGET=1 -DTVM_LLVM_VERSION=140 -DTVM_THREADPOOL_USE_OPENMP=0 -DTVM_USE_LIBBACKTRACE=0 -DUSE_FALLBACK_STL_MAP=0 -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/abuild/rpmbuild/BUILD/tvm-0.17.0/include -I/home/abuild/rpmbuild/BUILD/tvm-0.17.0/3rdparty/libcrc/include -isystem /usr/include/dlpack -isystem /usr/include/dmlc -isystem /usr/include/rang -isystem /home/abuild/rpmbuild/BUILD/tvm-0.17.0/3rdparty/compiler-rt -isystem /home/abuild/rpmbuild/BUILD/tvm-0.17.0/3rdparty/picojson -isystem /home/abuild/rpmbuild/BUILD/tvm-0.17.0/3rdparty/OpenCL-Headers -isystem /usr/include/spirv-tools -isystem /usr/include/spirv/unified1 -isystem /usr/include/openblas -std=c++17 -faligned-new -O2 -Wall -fPIC -mbranch-protection=standard -O2 -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type  -g -Wno-error=return-type -O2 -g -DNDEBUG -ffile-prefix-map=..=/home/abuild/rpmbuild/BUILD/tvm-0.17.0 -MD -MT CMakeFiles/tvm_runtime_objs.dir/src/runtime/disco/disco_worker.cc.o -MF CMakeFiles/tvm_runtime_objs.dir/src/runtime/disco/disco_worker.cc.o.d -o CMakeFiles/tvm_runtime_objs.dir/src/runtime/disco/disco_worker.cc.o -c /home/abuild/rpmbuild/BUILD/tvm-0.17.0/src/runtime/disco/disco_worker.cc
[   50s] In file included from /home/abuild/rpmbuild/BUILD/tvm-0.17.0/src/runtime/disco/./protocol.h:35,
[   50s]                  from /home/abuild/rpmbuild/BUILD/tvm-0.17.0/src/runtime/disco/disco_worker.cc:26:
[   50s] /home/abuild/rpmbuild/BUILD/tvm-0.17.0/src/runtime/disco/./../../support/base64.h:209:10: error: conflicting return type specified for ‘virtual size_t tvm::support::Base64InStream::Write(const void*, size_t)’
[   50s]   209 |   size_t Write(const void* ptr, size_t size) final {
[   50s]       |          ^~~~~
[   50s] In file included from /home/abuild/rpmbuild/BUILD/tvm-0.17.0/include/tvm/runtime/module.h:29,
[   50s]                  from /home/abuild/rpmbuild/BUILD/tvm-0.17.0/include/tvm/runtime/disco/builtin.h:23,
[   50s]                  from /home/abuild/rpmbuild/BUILD/tvm-0.17.0/src/runtime/disco/disco_worker.cc:19:
[   50s] /usr/include/dmlc/io.h:44:16: note: overridden function is ‘virtual void dmlc::Stream::Write(const void*, size_t)’
[   50s]    44 |   virtual void Write(const void *ptr, size_t size) = 0;
[   50s]       |                ^~~~~
[   50s] /home/abuild/rpmbuild/BUILD/tvm-0.17.0/src/runtime/disco/./../../support/base64.h:232:10: error: conflicting return type specified for ‘virtual size_t tvm::support::Base64OutStream::Write(const void*, size_t)’
[   50s]   232 |   size_t Write(const void* ptr, size_t size) final {
[   50s]       |          ^~~~~
[   50s] /usr/include/dmlc/io.h:44:16: note: overridden function is ‘virtual void dmlc::Stream::Write(const void*, size_t)’
[   50s]    44 |   virtual void Write(const void *ptr, size_t size) = 0;
[   50s]       |                ^~~~~
[   50s] /home/abuild/rpmbuild/BUILD/tvm-0.17.0/src/runtime/disco/./../../support/base64.h: In member function ‘virtual size_t tvm::support::Base64OutStream::Read(void*, size_t)’:
[   50s] /home/abuild/rpmbuild/BUILD/tvm-0.17.0/src/runtime/disco/./../../support/base64.h:253:19: warning: control reaches end of non-void function [-Wreturn-type]
[   50s]   253 |     LOG(FATAL) << "Base64OutStream do not support read";
[   50s]       |                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[   50s] make[2]: *** [CMakeFiles/tvm_runtime_objs.dir/build.make:191: CMakeFiles/tvm_runtime_objs.dir/src/runtime/disco/disco_worker.cc.o] Error 1
[   50s] make[2]: Leaving directory '/home/abuild/rpmbuild/BUILD/tvm-0.17.0/build_cmake'
[   50s] make[2]: *** Waiting for unfinished jobs....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-triage PRs or issues that need to be investigated by maintainers to find the right assignees to address it type: bug
Projects
None yet
Development

No branches or pull requests

1 participant