Please include cstdint for gcc 13 or later #17
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I met compilation errors on gcc 13.2.1.
It seems to be lack of include
<cstdint>
.This PR tries to solve it.
compilation errors on gcc 13.2.1
In file included from include/ftp/replies.hpp:28,
from include/ftp/file_list_reply.hpp:28,
from src/file_list_reply.cpp:25:
include/ftp/reply.hpp:40:24: error: expected ‘)’ before ‘code’
40 | reply(std::uint16_t code, std::string_view status_string);
| ~ ^~~~~
| )
include/ftp/reply.hpp:48:24: error: ‘uint16_t’ in namespace ‘std’ does not name a type; did you mean ‘wint_t’?
48 | [[nodiscard]] std::uint16_t get_code() const;
| ^~~~~~~~
| wint_t
include/ftp/reply.hpp:52:27: error: ‘uint16_t’ in namespace ‘std’ does not name a type; did you mean ‘wint_t’?
52 | static constexpr std::uint16_t unspecified = std::numeric_limitsstd::uint16_t::max();
| ^~~~~~~~
| wint_t
include/ftp/reply.hpp:55:10: error: ‘uint16_t’ in namespace ‘std’ does not name a type; did you mean ‘wint_t’?
55 | std::uint16_t code_;
| ^~~~~~~~
| wint_t
In file included from include/ftp/file_size_reply.hpp:28,
from src/file_size_reply.cpp:25:
include/ftp/reply.hpp:40:24: error: expected ‘)’ before ‘code’
40 | reply(std::uint16_t code, std::string_view status_string);
| ~ ^~~~~
| )
include/ftp/reply.hpp:48:24: error: ‘uint16_t’ in namespace ‘std’ does not name a type; did you mean ‘wint_t’?
48 | [[nodiscard]] std::uint16_t get_code() const;
| ^~~~~~~~
| wint_t
include/ftp/reply.hpp:52:27: error: ‘uint16_t’ in namespace ‘std’ does not name a type; did you mean ‘wint_t’?
52 | static constexpr std::uint16_t unspecified = std::numeric_limitsstd::uint16_t::max();
| ^~~~~~~~
| wint_t
include/ftp/reply.hpp:55:10: error: ‘uint16_t’ in namespace ‘std’ does not name a type; did you mean ‘wint_t’?
55 | std::uint16_t code_;
| ^~~~~~~~
| wint_t
include/ftp/file_size_reply.hpp:42:44: error: ‘uint64_t’ is not a member of ‘std’; did you mean ‘wint_t’?
42 | [[nodiscard]] const std::optionalstd::uint64_t & get_size() const;
| ^~~~~~~~
| wint_t
include/ftp/file_size_reply.hpp:42:52: error: template argument 1 is invalid
42 | [[nodiscard]] const std::optionalstd::uint64_t & get_size() const;
| ^
include/ftp/file_size_reply.hpp:42:30: error: ‘’ in namespace ‘std’ does not name a type
42 | [[nodiscard]] const std::optionalstd::uint64_t & get_size() const;
| ^~~~~~~~~~~~~~~~~~~~~~~
include/ftp/file_size_reply.hpp:45:31: error: ‘uint64_t’ is not a member of ‘std’; did you mean ‘wint_t’?
45 | static std::optionalstd::uint64_t parse_size(const reply & reply);
| ^~~~~~~~
| wint_t
include/ftp/file_size_reply.hpp:45:39: error: template argument 1 is invalid
45 | static std::optionalstd::uint64_t parse_size(const reply & reply);
| ^
include/ftp/file_size_reply.hpp:45:17: error: ‘’ in namespace ‘std’ does not name a type
45 | static std::optionalstd::uint64_t parse_size(const reply & reply);
| ^~~~~~~~~~~~~~~~~~~~~~~
include/ftp/file_size_reply.hpp:47:24: error: ‘uint64_t’ is not a member of ‘std’; did you mean ‘wint_t’?
47 | std::optionalstd::uint64_t size_;
| ^~~~~~~~
| wint_t
include/ftp/file_size_reply.hpp:47:32: error: template argument 1 is invalid
47 | std::optionalstd::uint64_t size_;
| ^
include/ftp/file_size_reply.hpp:47:10: error: ‘’ in namespace ‘std’ does not name a type
47 | std::optionalstd::uint64_t size_;
| ^~~~~~~~~~~~~~~~~~~~~~~
[ 76%] Building CXX object CMakeFiles/ftp.dir/src/ostream_adapter.cpp.o
gmake[2]: *** [CMakeFiles/ftp.dir/build.make:174: CMakeFiles/ftp.dir/src/file_list_reply.cpp.o] Error 1
gmake[2]: *** Waiting for unfinished jobs....
In file included from include/ftp/observer.hpp:28,
from include/ftp/client.hpp:28,
from src/client.cpp:25:
include/ftp/reply.hpp:40:24: error: expected ‘)’ before ‘code’
40 | reply(std::uint16_t code, std::string_view status_string);
| ~ ^~~~~
| )
include/ftp/reply.hpp:48:24: error: ‘uint16_t’ in namespace ‘std’ does not name a type; did you mean ‘wint_t’?
48 | [[nodiscard]] std::uint16_t get_code() const;
| ^~~~~~~~
| wint_t
include/ftp/reply.hpp:52:27: error: ‘uint16_t’ in namespace ‘std’ does not name a type; did you mean ‘wint_t’?
52 | static constexpr std::uint16_t unspecified = std::numeric_limitsstd::uint16_t::max();
| ^~~~~~~~
| wint_t
include/ftp/reply.hpp:55:10: error: ‘uint16_t’ in namespace ‘std’ does not name a type; did you mean ‘wint_t’?
55 | std::uint16_t code_;
| ^~~~~~~~
| wint_t
include/ftp/observer.hpp:37:58: error: ‘std::uint16_t’ has not been declared
37 | virtual void on_connected(std::string_view hostname, std::uint16_t port) { };
| ^~~
In file included from include/ftp/client.hpp:30:
include/ftp/file_size_reply.hpp:42:44: error: ‘uint64_t’ is not a member of ‘std’; did you mean ‘wint_t’?
42 | [[nodiscard]] const std::optionalstd::uint64_t & get_size() const;
| ^~~~~~~~
| wint_t
include/ftp/file_size_reply.hpp:42:52: error: template argument 1 is invalid
42 | [[nodiscard]] const std::optionalstd::uint64_t & get_size() const;
| ^
include/ftp/file_size_reply.hpp:42:30: error: ‘’ in namespace ‘std’ does not name a type
42 | [[nodiscard]] const std::optionalstd::uint64_t & get_size() const;
| ^~~~~~~~~~~~~~~~~~~~~~~
include/ftp/file_size_reply.hpp:45:31: error: ‘uint64_t’ is not a member of ‘std’; did you mean ‘wint_t’?
45 | static std::optionalstd::uint64_t parse_size(const reply & reply);
| ^~~~~~~~
| wint_t
include/ftp/file_size_reply.hpp:45:39: error: template argument 1 is invalid
45 | static std::optionalstd::uint64_t parse_size(const reply & reply);
| ^
include/ftp/file_size_reply.hpp:45:17: error: ‘’ in namespace ‘std’ does not name a type
45 | static std::optionalstd::uint64_t parse_size(const reply & reply);
| ^~~~~~~~~~~~~~~~~~~~~~~
include/ftp/file_size_reply.hpp:47:24: error: ‘uint64_t’ is not a member of ‘std’; did you mean ‘wint_t’?
47 | std::optionalstd::uint64_t size_;
| ^~~~~~~~
| wint_t
include/ftp/file_size_reply.hpp:47:32: error: template argument 1 is invalid
47 | std::optionalstd::uint64_t size_;
| ^
include/ftp/file_size_reply.hpp:47:10: error: ‘’ in namespace ‘std’ does not name a type
47 | std::optionalstd::uint64_t size_;
| ^~~~~~~~~~~~~~~~~~~~~~~
src/file_size_reply.cpp: In constructor ‘ftp::file_size_reply::file_size_reply(const ftp::reply&)’:
src/file_size_reply.cpp:40:5: error: ‘size_’ was not declared in this scope; did you mean ‘size_t’?
40 | size_ = parse_size(reply);
| ^~~~~
| size_t
src/file_size_reply.cpp:40:13: error: ‘parse_size’ was not declared in this scope
40 | size_ = parse_size(reply);
| ^~~~~~~~~~
src/file_size_reply.cpp: At global scope:
src/file_size_reply.cpp:43:38: error: no declaration matches ‘const std::optional& ftp::file_size_reply::get_size() const’
43 | const std::optionalstd::uint64_t & file_size_reply::get_size() const
| ^~~~~~~~~~~~~~~
src/file_size_reply.cpp:43:38: note: no functions named ‘const std::optional& ftp::file_size_reply::get_size() const’
include/ftp/file_size_reply.hpp:34:7: note: ‘class ftp::file_size_reply’ defined here
34 | class file_size_reply : public reply
| ^~~~~~~~~~~~~~~
src/file_size_reply.cpp:48:30: error: no declaration matches ‘std::optional ftp::file_size_reply::parse_size(const ftp::reply&)’
48 | std::optionalstd::uint64_t file_size_reply::parse_size(const reply & reply)
| ^~~~~~~~~~~~~~~
src/file_size_reply.cpp:48:30: note: no functions named ‘std::optional ftp::file_size_reply::parse_size(const ftp::reply&)’
include/ftp/file_size_reply.hpp:34:7: note: ‘class ftp::file_size_reply’ defined here
34 | class file_size_reply : public reply
| ^~~~~~~~~~~~~~~
gmake[2]: *** [CMakeFiles/ftp.dir/build.make:188: CMakeFiles/ftp.dir/src/file_size_reply.cpp.o] Error 1
src/client.cpp: In member function ‘ftp::replies ftp::client::rename(std::string_view, std::string_view)’:
src/client.cpp:210:15: error: ‘class ftp::reply’ has no member named ‘get_code’
210 | if (reply.get_code() == 350)
| ^~~~~~~~
src/client.cpp: In member function ‘ftp::reply ftp::client::process_login(std::string_view, std::string_view, ftp::replies&)’:
src/client.cpp:432:15: error: ‘class ftp::reply’ has no member named ‘get_code’
432 | if (reply.get_code() == 331)
| ^~~~~~~~
src/client.cpp: In member function ‘ftp::reply ftp::client::process_abort(ftp::replies&)’:
src/client.cpp:522:15: error: ‘class ftp::reply’ has no member named ‘get_code’
522 | if (reply.get_code() == 426)
| ^~~~~~~~
gmake[2]: *** [CMakeFiles/ftp.dir/build.make:132: CMakeFiles/ftp.dir/src/client.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/ftp.dir/all] Error 2
gmake: *** [Makefile:136: all] Error 2