Opened 2 months ago
Last modified 4 weeks ago
#73623 new defect
ccache+doc undeclared identifier 'uint64_t' nonstd::expected<uint64_t, std::string>
| Reported by: | rmottola (Riccardo) | Owned by: | |
|---|---|---|---|
| Priority: | Normal | Milestone: | |
| Component: | ports | Version: | |
| Keywords: | leopard clang | Cc: | |
| Port: | ccache |
Description
on Leopard 10.5 I get with clang 11
[ 69%] Building CXX object src/CMakeFiles/ccache_framework.dir/util/string.cpp.o
cd /opt/local/var/macports/build/ccache-7cda70d7/work/build/src && /opt/local/bin/clang++-mp-11 -DHAVE_REDIS_STORAGE_BACKEND -DXXH_STATIC_LINKING_ONLY -Dnssv_CONFIG_SELECT_STRING_VIEW=nssv_STRING_VIEW_NONSTD -I/opt/local/var/macports/build/ccache-7cda70d7/work/build -I/opt/local/var/macports/build/ccache-7cda70d7/work/ccache-4.6.3/src -isystem /opt/local/include -pipe -Os -DNDEBUG -I/opt/local/include -stdlib=macports-libstdc++ -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++14 -arch x86_64 -mmacosx-version-min=10.5 -include /opt/local/var/macports/build/ccache-7cda70d7/work/build/config.h -Wall -D_FILE_OFFSET_BITS=64 -MD -MT src/CMakeFiles/ccache_framework.dir/util/string.cpp.o -MF CMakeFiles/ccache_framework.dir/util/string.cpp.o.d -o CMakeFiles/ccache_framework.dir/util/string.cpp.o -c /opt/local/var/macports/build/ccache-7cda70d7/work/ccache-4.6.3/src/util/string.cpp
In file included from /opt/local/var/macports/build/ccache-7cda70d7/work/ccache-4.6.3/src/util/string.cpp:19:
/opt/local/var/macports/build/ccache-7cda70d7/work/ccache-4.6.3/src/util/string.hpp:76:18: error: use of undeclared identifier 'uint64_t'
nonstd::expected<uint64_t, std::string>
^
/opt/local/var/macports/build/ccache-7cda70d7/work/ccache-4.6.3/src/util/string.hpp:78:33: error: use of undeclared identifier 'uint64_t'
nonstd::optional<uint64_t> min_value = nonstd::nullopt,
^
/opt/local/var/macports/build/ccache-7cda70d7/work/ccache-4.6.3/src/util/string.hpp:78:43: error: no viable conversion from 'const nonstd::optional_lite::nullopt_t' to 'int'
nonstd::optional<uint64_t> min_value = nonstd::nullopt,
^ ~~~~~~~~~~~~~~~
/opt/local/var/macports/build/ccache-7cda70d7/work/ccache-4.6.3/src/util/string.hpp:78:43: note: passing argument to parameter 'min_value' here
/opt/local/var/macports/build/ccache-7cda70d7/work/ccache-4.6.3/src/util/string.hpp:79:33: error: use of undeclared identifier 'uint64_t'
nonstd::optional<uint64_t> max_value = nonstd::nullopt,
^
/opt/local/var/macports/build/ccache-7cda70d7/work/ccache-4.6.3/src/util/string.hpp:79:43: error: no viable conversion from 'const nonstd::optional_lite::nullopt_t' to 'int'
nonstd::optional<uint64_t> max_value = nonstd::nullopt,
^ ~~~~~~~~~~~~~~~
/opt/local/var/macports/build/ccache-7cda70d7/work/ccache-4.6.3/src/util/string.hpp:79:43: note: passing argument to parameter 'max_value' here
Attachments (1)
Change History (3)
comment:1 Changed 2 months ago by rmottola (Riccardo)
comment:2 Changed 4 weeks ago by rmottola (Riccardo)
I got into this same issue on 10.5 PPC with gcc 15 and there I just needed a single patch - attached.
Changed 4 weeks ago by rmottola (Riccardo)
| Attachment: | ccache_stdint1.patch added |
|---|
Note: See
TracTickets for help on using
tickets.

I tried brand new gcc 15 and got this:
In file included from /opt/local/var/macports/build/ccache-7cda70d7/work/ccache-4.6.3/src/util/string.cpp:19: /opt/local/var/macports/build/ccache-7cda70d7/work/ccache-4.6.3/src/util/string.hpp:76:18: error: 'uint64_t' was not declared in this scope 76 | nonstd::expected<uint64_t, std::string> | ^~~~~~~~ /opt/local/var/macports/build/ccache-7cda70d7/work/ccache-4.6.3/src/util/string.hpp:28:1: note: 'uint64_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>' 27 | #include <cstring> +++ |+#include <cstdint> 28 | #include <string> /opt/local/var/macports/build/ccache-7cda70d7/work/ccache-4.6.3/src/util/string.hpp:76:39: error: template argument 1 is invalid 76 | nonstd::expected<uint64_t, std::string> | ^I took the suggestion literal and tried a quick edit of ccache-4.6.3/src/util/string.hpp
and it did successfully build with gcc15. Then I retried with clang11 and it did build too.
At a first glance this looks like a legit fix for all compilers. Unfortunately I just did hack away without creating a patch