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

Compilation failures with clang on Fedora 37 #800

Closed
jiridanek opened this issue Oct 22, 2022 · 3 comments · Fixed by #803, #805 or #812
Closed

Compilation failures with clang on Fedora 37 #800

jiridanek opened this issue Oct 22, 2022 · 3 comments · Fixed by #803, #805 or #812

Comments

@jiridanek
Copy link
Contributor

There is multiple issues:

/usr/bin/clang  -I/home/jdanek/repos/skupper-router/include -I/home/jdanek/repos/skupper-router/cmake-build-relwithdebinfo-clang/include -I/usr/include/python3.11 -I/home/jdanek/repos/skupper-router/cmake-build-relwithdebinfo-clang/src -I/home/jdanek/repos/skupper-router/src -I/home/jdanek/repos/skupper-router/src/router_core -isystem /home/jdanek/repos/qpid/qpid-proton/build/install/include -O2 -g -DNDEBUG -fcolor-diagnostics -Wall -Wextra -Werror -Wpedantic -Wno-unused-parameter -Wno-missing-field-initializers -Wno-sign-compare -Wno-language-extension-token -gdwarf-aranges -std=gnu11 -MD -MT src/CMakeFiles/skupper-router.dir/adaptors/adaptor_common.c.o -MF src/CMakeFiles/skupper-router.dir/adaptors/adaptor_common.c.o.d -o src/CMakeFiles/skupper-router.dir/adaptors/adaptor_common.c.o -c /home/jdanek/repos/skupper-router/src/adaptors/adaptor_common.c
In file included from /home/jdanek/repos/skupper-router/src/adaptors/adaptor_common.c:19:
In file included from /home/jdanek/repos/skupper-router/src/adaptors/adaptor_common.h:24:
In file included from /home/jdanek/repos/skupper-router/src/entity.h:22:
/home/jdanek/repos/skupper-router/include/qpid/dispatch/error.h:83:39: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
QD_EXPORT const char* qd_error_message();
                                      ^
                                       void
  • Second, some options for tests subfolders that are unknown in clang
FAILED: tests/c_unittests/CMakeFiles/c_unittests.dir/test_terminus.cpp.o 
/usr/bin/clang++ -Dc_unittests_EXPORTS -I/home/jdanek/repos/skupper-router/include -I/home/jdanek/repos/skupper-router/cmake-build-relwithdebinfo-clang/include -I/home/jdanek/repos/qpid/qpid-proton/build/install/include -I/usr/include/python3.11 -I/home/jdanek/repos/skupper-router/src -I/home/jdanek/repos/skupper-router/cmake-build-relwithdebinfo-clang/src -I/home/jdanek/repos/skupper-router/src/router_core -I/home/jdanek/repos/skupper-router/tests/cpp-stub -fno-inline -fno-builtin -fno-stack-protector -Wno-literal-suffix -O2 -g -DNDEBUG -fcolor-diagnostics -Wall -Wextra -Werror -Wpedantic -Wno-unused-parameter -Wno-missing-field-initializers -Wno-sign-compare -Wno-language-extension-token -gdwarf-aranges -std=c++17 -MD -MT tests/c_unittests/CMakeFiles/c_unittests.dir/test_terminus.cpp.o -MF tests/c_unittests/CMakeFiles/c_unittests.dir/test_terminus.cpp.o.d -o tests/c_unittests/CMakeFiles/c_unittests.dir/test_terminus.cpp.o -c /home/jdanek/repos/skupper-router/tests/c_unittests/test_terminus.cpp
error: unknown warning option '-Wno-literal-suffix'; did you mean '-Wno-literal-range'? [-Werror,-Wunknown-warning-option]
@jiridanek
Copy link
Contributor Author

  • @kgiusti, @ganeshmurthy The reason why clang might be good in CI is that Add Clang Thread Safety Annotations #212 feature. Other than that, supporting clang is clearly a chore with unclear benefits (given that users are not asking for it). I suggest fixing the issues ^^^ in one-off round of fixes and not adding clang job to ci.

Clang job in CI would require contributors to fix clang issues as they appear. There is unlikely to be many, since both GCC and Clang implement the standard, Clang implements gcc switches, CMake also helps with portability, and so differences are minor, but it is still a drain sometimes.

jiridanek added a commit to jiridanek/skupper-router that referenced this issue Oct 22, 2022
jiridanek added a commit to jiridanek/skupper-router that referenced this issue Oct 22, 2022
jiridanek added a commit to jiridanek/skupper-router that referenced this issue Oct 22, 2022
@jiridanek
Copy link
Contributor Author

Consider GCC option to catch the #803 declarations in GCC as well https://stackoverflow.com/questions/50401100/compiler-warning-for-function-defined-without-prototype-in-scope

@jiridanek
Copy link
Contributor Author

Consider GCC option to catch the #803 declarations in GCC as well https://stackoverflow.com/questions/50401100/compiler-warning-for-function-defined-without-prototype-in-scope

https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html

  • -Wmissing-prototypes
  • -Wmissing-declarations
  • -Wstrict-prototypes
  • -Wold-style-definition

A definition using ‘()’ is not considered an old-style definition in C2X mode, because it is equivalent to ‘(void)’ in that case, but is considered an old-style definition for older standards.

jiridanek added a commit to jiridanek/skupper-router that referenced this issue Oct 26, 2022
jiridanek added a commit to jiridanek/skupper-router that referenced this issue Oct 26, 2022
jiridanek added a commit to jiridanek/skupper-router that referenced this issue Oct 26, 2022
jiridanek added a commit to jiridanek/skupper-router that referenced this issue Oct 26, 2022
jiridanek added a commit to jiridanek/skupper-router that referenced this issue Oct 26, 2022
jiridanek added a commit to jiridanek/skupper-router that referenced this issue Oct 26, 2022
jiridanek added a commit to jiridanek/skupper-router that referenced this issue Oct 26, 2022
jiridanek added a commit to jiridanek/skupper-router that referenced this issue Oct 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment