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

Please include cstdint for gcc 13 or later #17

Merged
merged 1 commit into from
Mar 25, 2024

Conversation

toge
Copy link
Contributor

@toge toge commented Mar 25, 2024

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

@deniskovalchuk deniskovalchuk merged commit a29cb11 into deniskovalchuk:develop Mar 25, 2024
3 checks passed
@deniskovalchuk
Copy link
Owner

Thanks!

@deniskovalchuk
Copy link
Owner

@toge
Do I need to release these changes to move forward with conan center index?

@toge
Copy link
Contributor Author

toge commented Mar 25, 2024

@deniskovalchuk
If possible, it would be very helpful!
I would like to package the upstream source as is without making patches as much as possible.

@deniskovalchuk
Copy link
Owner

@toge
OK. v0.4.1 is now available.

@toge
Copy link
Contributor Author

toge commented Mar 28, 2024

@deniskovalchuk
Now libftp's conan recipe has been published! https://conan.io/center/recipes/libftp
Thanks a lot!

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