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

Add missing #include directives for gcc13 #1596

Merged
merged 1 commit into from
Jan 30, 2023

Conversation

aekoroglu
Copy link
Contributor

Contributor Checklist:

  • I have created a file in the doc/newsfragments directory IF it is a
    user-visible change (and make sure to read the README.md in that directory)

@shymega
Copy link
Member

shymega commented Jan 26, 2023

@aekoroglu Is this a necessary PR? As far as I can see, compiling locally from master doesn't encounter any issues for me. Can you edit your commit messages to justify the change?

@shymega shymega requested a review from p12tic January 26, 2023 17:06
@shymega shymega self-assigned this Jan 26, 2023
@aekoroglu
Copy link
Contributor Author

Yes sure, if you try to compile master or 2.4.0 branch with gcc13 you'll see this

[ 14%] Linking CXX executable ../../bin/guiunittests
cd /home/aekoroglu/input-leap/redhat-linux-build/src/gui && /usr/bin/cmake -E cmake_link_script CMakeFiles/guiunittests.dir/link.txt --verbose=1
/usr/bin/c++ CMakeFiles/guiunittests.dir/guiunittests_autogen/mocs_compilation.cpp.o CMakeFiles/guiunittests.dir/test/KeySequenceTests.cpp.o CMakeFiles/guiunittests.dir/test/HotkeyTests.cpp.o CMakeFiles/guiunittests.dir/test/main.cpp.o CMakeFiles/guiunittests.dir/src/Action.cpp.o CMakeFiles/guiunittests.dir/src/Hotkey.cpp.o CMakeFiles/guiunittests.dir/src/KeySequence.cpp.o -o ../../bin/guiunittests  -lgtest -lgmock /usr/lib64/libQt5Widgets.so.5.15.8 /usr/lib64/libQt5Network.so.5.15.8 /usr/lib64/libcurl.so /usr/lib64/libX11.so /usr/lib64/libXext.so /usr/lib64/libXrandr.so /usr/lib64/libXinerama.so /usr/lib64/libXtst.so /usr/lib64/libXi.so /usr/lib64/libICE.so /usr/lib64/libSM.so /usr/lib64/libQt5Gui.so.5.15.8 /usr/lib64/libQt5Core.so.5.15.8 
In file included from /home/aekoroglu/input-leap/src/lib/base/XBase.cpp:20:
/home/aekoroglu/input-leap/src/./lib/base/String.h:75:43: error: ‘uint8_t’ is not a member of ‘std’; did you mean ‘wint_t’?
   75 | std::string to_hex(const std::vector<std::uint8_t>& subject, int width, const char fill = '0');
      |                                           ^~~~~~~
      |                                           wint_t
/home/aekoroglu/input-leap/src/./lib/base/String.h:75:43: error: ‘uint8_t’ is not a member of ‘std’; did you mean ‘wint_t’?
   75 | std::string to_hex(const std::vector<std::uint8_t>& subject, int width, const char fill = '0');
      |                                           ^~~~~~~
      |                                           wint_t
/home/aekoroglu/input-leap/src/./lib/base/String.h:75:50: error: template argument 1 is invalid
   75 | std::string to_hex(const std::vector<std::uint8_t>& subject, int width, const char fill = '0');
      |                                                  ^
/home/aekoroglu/input-leap/src/./lib/base/String.h:75:50: error: template argument 2 is invalid
/home/aekoroglu/input-leap/src/./lib/base/String.h:78:18: error: ‘uint8_t’ is not a member of ‘std’; did you mean ‘wint_t’?
   78 | std::vector<std::uint8_t> from_hex(const std::string& data);
      |                  ^~~~~~~
      |                  wint_t
/home/aekoroglu/input-leap/src/./lib/base/String.h:78:18: error: ‘uint8_t’ is not a member of ‘std’; did you mean ‘wint_t’?
   78 | std::vector<std::uint8_t> from_hex(const std::string& data);
      |                  ^~~~~~~
      |                  wint_t
/home/aekoroglu/input-leap/src/./lib/base/String.h:78:25: error: template argument 1 is invalid
   78 | std::vector<std::uint8_t> from_hex(const std::string& data);
      |                         ^
/home/aekoroglu/input-leap/src/./lib/base/String.h:78:25: error: template argument 2 is invalid
In file included from /home/aekoroglu/input-leap/src/lib/net/FingerprintDatabase.cpp:18:
/home/aekoroglu/input-leap/src/./lib/base/String.h:75:43: error: ‘uint8_t’ is not a member of ‘std’; did you mean ‘wint_t’?
   75 | std::string to_hex(const std::vector<std::uint8_t>& subject, int width, const char fill = '0');
      |                                           ^~~~~~~
      |                                           wint_t
/home/aekoroglu/input-leap/src/./lib/base/String.h:75:43: error: ‘uint8_t’ is not a member of ‘std’; did you mean ‘wint_t’?
   75 | std::string to_hex(const std::vector<std::uint8_t>& subject, int width, const char fill = '0');
      |                                           ^~~~~~~
      |                                           wint_t
/home/aekoroglu/input-leap/src/./lib/base/String.h:75:50: error: template argument 1 is invalid
   75 | std::string to_hex(const std::vector<std::uint8_t>& subject, int width, const char fill = '0');
      |                                                  ^
/home/aekoroglu/input-leap/src/./lib/base/String.h:75:50: error: template argument 2 is invalid
/home/aekoroglu/input-leap/src/./lib/base/String.h:78:18: error: ‘uint8_t’ is not a member of ‘std’; did you mean ‘wint_t’?
   78 | std::vector<std::uint8_t> from_hex(const std::string& data);
      |                  ^~~~~~~
      |                  wint_t
/home/aekoroglu/input-leap/src/./lib/base/String.h:78:18: error: ‘uint8_t’ is not a member of ‘std’; did you mean ‘wint_t’?
   78 | std::vector<std::uint8_t> from_hex(const std::string& data);
      |                  ^~~~~~~
      |                  wint_t
/home/aekoroglu/input-leap/src/./lib/base/String.h:78:25: error: template argument 1 is invalid
   78 | std::vector<std::uint8_t> from_hex(const std::string& data);
      |                         ^
/home/aekoroglu/input-leap/src/./lib/base/String.h:78:25: error: template argument 2 is invalid
In file included from /home/aekoroglu/input-leap/src/lib/net/FingerprintDatabase.h:21,
                 from /home/aekoroglu/input-leap/src/lib/net/FingerprintDatabase.cpp:19:
/home/aekoroglu/input-leap/src/lib/net/FingerprintData.h:34:22: error: ‘uint8_t’ is not a member of ‘std’; did you mean ‘wint_t’?
   34 |     std::vector<std::uint8_t> data;
      |                      ^~~~~~~
      |                      wint_t
/home/aekoroglu/input-leap/src/lib/net/FingerprintData.h:34:22: error: ‘uint8_t’ is not a member of ‘std’; did you mean ‘wint_t’?
   34 |     std::vector<std::uint8_t> data;
      |                      ^~~~~~~
      |                      wint_t
/home/aekoroglu/input-leap/src/lib/net/FingerprintData.h:34:29: error: template argument 1 is invalid
   34 |     std::vector<std::uint8_t> data;
      |                             ^
/home/aekoroglu/input-leap/src/lib/net/FingerprintData.h:34:29: error: template argument 2 is invalid
gmake[2]: *** [src/lib/base/CMakeFiles/base.dir/build.make:191: src/lib/base/CMakeFiles/base.dir/XBase.cpp.o] Error 1
gmake[2]: Leaving directory '/home/aekoroglu/input-leap/redhat-linux-build'
gmake[1]: *** [CMakeFiles/Makefile2:431: src/lib/base/CMakeFiles/base.dir/all] Error 2
gmake[1]: *** Waiting for unfinished jobs....
In file included from /home/aekoroglu/input-leap/src/lib/net/FingerprintDatabase.h:21,
                 from /home/aekoroglu/input-leap/src/lib/net/FingerprintData.cpp:18:
/home/aekoroglu/input-leap/src/lib/net/FingerprintData.h:34:22: error: ‘uint8_t’ is not a member of ‘std’; did you mean ‘wint_t’?
   34 |     std::vector<std::uint8_t> data;
      |                      ^~~~~~~
      |                      wint_t
/home/aekoroglu/input-leap/src/lib/net/FingerprintData.h:34:22: error: ‘uint8_t’ is not a member of ‘std’; did you mean ‘wint_t’?
   34 |     std::vector<std::uint8_t> data;
      |                      ^~~~~~~
      |                      wint_t
/home/aekoroglu/input-leap/src/lib/net/FingerprintData.h:34:29: error: template argument 1 is invalid
   34 |     std::vector<std::uint8_t> data;
      |                             ^
/home/aekoroglu/input-leap/src/lib/net/FingerprintData.h:34:29: error: template argument 2 is invalid
In file included from /home/aekoroglu/input-leap/src/lib/net/SecureUtils.h:21,
                 from /home/aekoroglu/input-leap/src/lib/net/SecureUtils.cpp:46:
/home/aekoroglu/input-leap/src/lib/net/FingerprintData.h:34:22: error: ‘uint8_t’ is not a member of ‘std’; did you mean ‘wint_t’?
   34 |     std::vector<std::uint8_t> data;
      |                      ^~~~~~~
      |                      wint_t
/home/aekoroglu/input-leap/src/lib/net/FingerprintData.h:34:22: error: ‘uint8_t’ is not a member of ‘std’; did you mean ‘wint_t’?
   34 |     std::vector<std::uint8_t> data;
      |                      ^~~~~~~
      |                      wint_t
/home/aekoroglu/input-leap/src/lib/net/FingerprintData.h:34:29: error: template argument 1 is invalid
   34 |     std::vector<std::uint8_t> data;
      |                             ^
/home/aekoroglu/input-leap/src/lib/net/FingerprintData.h:34:29: error: template argument 2 is invalid
/home/aekoroglu/input-leap/src/lib/net/FingerprintDatabase.cpp: In static member function ‘static inputleap::FingerprintData inputleap::FingerprintDatabase::parse_db_line(const std::string&)’:
/home/aekoroglu/input-leap/src/lib/net/FingerprintDatabase.cpp:98:18: error: request for member ‘empty’ in ‘data’, which is of non-class type ‘int’
   98 |         if (data.empty()) {
      |                  ^~~~~
/home/aekoroglu/input-leap/src/lib/net/FingerprintDatabase.cpp:121:14: error: request for member ‘empty’ in ‘data’, which is of non-class type ‘int’
  121 |     if (data.empty()) {
      |              ^~~~~
gmake[2]: *** [src/lib/net/CMakeFiles/net.dir/build.make:93: src/lib/net/CMakeFiles/net.dir/FingerprintDatabase.cpp.o] Error 1
gmake[2]: *** Waiting for unfinished jobs....
gmake[2]: *** [src/lib/net/CMakeFiles/net.dir/build.make:79: src/lib/net/CMakeFiles/net.dir/FingerprintData.cpp.o] Error 1
/home/aekoroglu/input-leap/src/lib/net/SecureUtils.cpp: In function ‘inputleap::FingerprintData inputleap::get_ssl_cert_fingerprint(X509*, FingerprintType)’:
/home/aekoroglu/input-leap/src/lib/net/SecureUtils.cpp:141:57: error: could not convert ‘{inputleap::fingerprint_type_to_string(type), digest_vec}’ from ‘<brace-enclosed initializer list>’ to ‘inputleap::FingerprintData’
  141 |     return {fingerprint_type_to_string(type), digest_vec};
      |                                                         ^
      |                                                         |
      |                                                         <brace-enclosed initializer list>
/home/aekoroglu/input-leap/src/lib/net/SecureUtils.cpp: In function ‘void inputleap::generate_pem_self_signed_cert(const std::string&)’:
/home/aekoroglu/input-leap/src/lib/net/SecureUtils.cpp:171:33: warning: ‘RSA* RSA_generate_key(int, long unsigned int, void (*)(int, int, void*), void*)’ is deprecated: Since OpenSSL 0.9.8 [-Wdeprecated-declarations]
  171 |     auto* rsa = RSA_generate_key(2048, RSA_F4, nullptr, nullptr);
      |                 ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/openssl/x509.h:36,
                 from /home/aekoroglu/input-leap/src/lib/net/SecureUtils.cpp:52:
/usr/include/openssl/rsa.h:258:30: note: declared here
  258 | OSSL_DEPRECATEDIN_0_9_8 RSA *RSA_generate_key(int bits, unsigned long e, void
      |                              ^~~~~~~~~~~~~~~~
gmake[2]: Leaving directory '/home/aekoroglu/input-leap/redhat-linux-build'
gmake[2]: *** [src/lib/net/CMakeFiles/net.dir/build.make:163: src/lib/net/CMakeFiles/net.dir/SecureUtils.cpp.o] Error 1
gmake[2]: Leaving directory '/home/aekoroglu/input-leap/redhat-linux-build'
gmake[1]: *** [CMakeFiles/Makefile2:588: src/lib/net/CMakeFiles/net.dir/all] Error 2
[ 17%] Built target guiunittests
gmake[1]: Leaving directory '/home/aekoroglu/input-leap/redhat-linux-build'
gmake: *** [Makefile:169: all] Error 2

gcc + cmake

[aekoroglu@rawhide input-leap]$ cmake --version
cmake version 3.25.2

CMake suite maintained and supported by Kitware (kitware.com/cmake).
[aekoroglu@rawhide input-leap]$ gcc --version
gcc (GCC) 13.0.1 20230117 (Red Hat 13.0.1-0)
Copyright (C) 2023 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

@shymega
Copy link
Member

shymega commented Jan 26, 2023

What distro are you on? With v2.4.0, that's already been released, so this cstdint might need to be backported, but I'll leave that up to @p12tic to decide on the best point of contact.

Thing is, I'm on Arch, and tests haven't failed on CI for previous commits, so that's why I'm asking which distro you're on. Arch builds with that same script just fine, save for the OpenSSL errors.

@shymega
Copy link
Member

shymega commented Jan 26, 2023

What I'd like to see is an amended commit giving more details and background for the change.

@aekoroglu
Copy link
Contributor Author

aekoroglu commented Jan 27, 2023

I'm on Fedora38 and according to distrowatch (1) arch is using gcc 12.2.1.
The change is required to fix this compilation error which you can only re-produce with gcc13.
We also had the same issue (2,3) with barrier and sent the same fix to upstream (4).

1 : https://distrowatch.com/table.php?distribution=arch
2 : https://kojipkgs.fedoraproject.org//work/tasks/3122/96313122/build.log
3 : https://bugzilla.redhat.com/show_bug.cgi?id=2113118
4 : debauchee/barrier#1886

@shymega
Copy link
Member

shymega commented Jan 30, 2023

OK. That explains why it compiles fine on Arch, and on CI - on CI we only test on Ubuntu. We do test RPM builds on Fedora 36, but that needs to be updated - what version would you suggest going forward?

I'll merge this now, as @p12tic I think is busy, and we can look into backporting to the v2.4.0 tag. I'll make an issue for that.

Thanks.

@shymega shymega merged commit 68aac94 into input-leap:master Jan 30, 2023
@simotek
Copy link

simotek commented Mar 27, 2023

Thanks openSUSE started hitting this issue this week in barrier with the move to gcc13

@shymega
Copy link
Member

shymega commented Mar 28, 2023

@simotek I'm glad it works for you. I haven't yet been able to investigate backporting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants