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

Fix C++ standard, should be 2017 #998

Closed
wants to merge 1 commit into from

Conversation

barracuda156
Copy link

It does not build with C++11, and compiler explicitly asks for C++17.

@barracuda156
Copy link
Author

Here is what happens with C++11 being required (gcc still chooses C++14, and that still fails):

In file included from /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_CLI11/CLI11/work/CLI11-2.4.0/include/CLI/StringTools.hpp:266,
                 from /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_CLI11/CLI11/work/CLI11-2.4.0/include/CLI/CLI.hpp:20,
                 from /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_CLI11/CLI11/work/CLI11-2.4.0/tests/applications/ensure_utf8_twice.cpp:7:
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_CLI11/CLI11/work/CLI11-2.4.0/include/CLI/impl/StringTools_inl.hpp:218:19: error: 'uint32_t' in namespace 'std' does not name a type; did you mean 'wint_t'?
  218 | CLI11_INLINE std::uint32_t hexConvert(char hc) {
      |                   ^~~~~~~~
      |                   wint_t
In file included from /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_CLI11/CLI11/work/CLI11-2.4.0/include/CLI/CLI.hpp:14:
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_CLI11/CLI11/work/CLI11-2.4.0/include/CLI/Macros.hpp:129:22: warning: inline variables are only available with '-std=c++17' or '-std=gnu++17' [-Wc++17-extensions]
  129 | #define CLI11_INLINE inline
      |                      ^~~~~~
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_CLI11/CLI11/work/CLI11-2.4.0/include/CLI/impl/StringTools_inl.hpp:232:1: note: in expansion of macro 'CLI11_INLINE'
  232 | CLI11_INLINE char make_char(std::uint32_t code) { return static_cast<char>(static_cast<unsigned char>(code)); }
      | ^~~~~~~~~~~~
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_CLI11/CLI11/work/CLI11-2.4.0/include/CLI/impl/StringTools_inl.hpp:232:34: error: 'uint32_t' is not a member of 'std'; did you mean 'wint_t'?
  232 | CLI11_INLINE char make_char(std::uint32_t code) { return static_cast<char>(static_cast<unsigned char>(code)); }
      |                                  ^~~~~~~~
      |                                  wint_t
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_CLI11/CLI11/work/CLI11-2.4.0/include/CLI/impl/StringTools_inl.hpp:234:59: error: 'std::uint32_t' has not been declared
  234 | CLI11_INLINE void append_codepoint(std::string &str, std::uint32_t code) {
      |                                                           ^~~~~~~~
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_CLI11/CLI11/work/CLI11-2.4.0/include/CLI/impl/StringTools_inl.hpp: In function 'void CLI::detail::append_codepoint(std::string&, int)':
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_CLI11/CLI11/work/CLI11-2.4.0/include/CLI/impl/StringTools_inl.hpp:239:32: error: 'CLI::detail::make_char' cannot be used as a function
  239 |         str.push_back(make_char(0xC0 | code >> 6));
      |                       ~~~~~~~~~^~~~~~~~~~~~~~~~~~
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_CLI11/CLI11/work/CLI11-2.4.0/include/CLI/impl/StringTools_inl.hpp:240:32: error: 'CLI::detail::make_char' cannot be used as a function
  240 |         str.push_back(make_char(0x80 | (code & 0x3F)));
      |                       ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_CLI11/CLI11/work/CLI11-2.4.0/include/CLI/impl/StringTools_inl.hpp:246:32: error: 'CLI::detail::make_char' cannot be used as a function
  246 |         str.push_back(make_char(0xE0 | code >> 12));
      |                       ~~~~~~~~~^~~~~~~~~~~~~~~~~~~
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_CLI11/CLI11/work/CLI11-2.4.0/include/CLI/impl/StringTools_inl.hpp:247:32: error: 'CLI::detail::make_char' cannot be used as a function
  247 |         str.push_back(make_char(0x80 | (code >> 6 & 0x3F)));
      |                       ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_CLI11/CLI11/work/CLI11-2.4.0/include/CLI/impl/StringTools_inl.hpp:248:32: error: 'CLI::detail::make_char' cannot be used as a function
  248 |         str.push_back(make_char(0x80 | (code & 0x3F)));
      |                       ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_CLI11/CLI11/work/CLI11-2.4.0/include/CLI/impl/StringTools_inl.hpp:251:32: error: 'CLI::detail::make_char' cannot be used as a function
  251 |         str.push_back(make_char(0xF0 | code >> 18));
      |                       ~~~~~~~~~^~~~~~~~~~~~~~~~~~~
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_CLI11/CLI11/work/CLI11-2.4.0/include/CLI/impl/StringTools_inl.hpp:252:32: error: 'CLI::detail::make_char' cannot be used as a function
  252 |         str.push_back(make_char(0x80 | (code >> 12 & 0x3F)));
      |                       ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_CLI11/CLI11/work/CLI11-2.4.0/include/CLI/impl/StringTools_inl.hpp:253:32: error: 'CLI::detail::make_char' cannot be used as a function
  253 |         str.push_back(make_char(0x80 | (code >> 6 & 0x3F)));
      |                       ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
. . .

@barracuda156
Copy link
Author

See also, as an example of a similar issue: pytorch/FBGEMM#1470 (comment)

@henryiii
Copy link
Collaborator

henryiii commented Feb 5, 2024

Does #996 fix this?

@barracuda156
Copy link
Author

barracuda156 commented Feb 5, 2024

Does #996 fix this?

@henryiii Let me try.

UPD. Yes, that works too, closing this one.

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.

2 participants