Hauke Mehrtens
2026-07-05 16:07:52 +02:00
committed by Josef Schlehofer
parent 213d90b417
commit 4d88f35c8d
7 changed files with 9 additions and 581 deletions
+4 -4
View File
@@ -39,12 +39,12 @@ ifeq ($(PKG_VERSION),13.4.0)
PKG_HASH:=9c4ce6dbb040568fdc545588ac03c5cbc95a8dbf0c7aa490170843afb59ca8f5
endif
ifeq ($(PKG_VERSION),14.3.0)
PKG_HASH:=e0dc77297625631ac8e50fa92fffefe899a4eb702592da5c32ef04e2293aca3a
ifeq ($(PKG_VERSION),14.4.0)
PKG_HASH:=752b6f567beac83159c77a7680b1316bdd784738bff9a9d070112c09da90f6d9
endif
ifeq ($(PKG_VERSION),15.2.0)
PKG_HASH:=438fd996826b0c82485a29da03a72d71d6e3541a83ec702df4271f6fe025d24e
ifeq ($(PKG_VERSION),15.3.0)
PKG_HASH:=fa59c1beef8995f27c4d71c1df227587189315d3e6faff1bb4306e61b0c530eb
endif
PATCH_DIR:=patches-$(GCC_MAJOR_VERSION).x
@@ -1,250 +0,0 @@
From daa3e1ead791bc58208043cfc4595ba1a78cdd34 Mon Sep 17 00:00:00 2001
From: Jakub Jelinek <jakub@redhat.com>
Date: Fri, 21 Nov 2025 16:25:58 +0100
Subject: [PATCH] libcody: Make it buildable by C++11 to C++26
The following builds with -std=c++11 and c++14 and c++17 and c++20 and c++23
and c++26.
I see the u8 string literals are mixed e.g. with strerror, so in
-fexec-charset=IBM1047 there will still be garbage, so am not 100% sure if
the u8 literals everywhere are worth it either.
2025-11-21 Jakub Jelinek <jakub@redhat.com>
* cody.hh (S2C): For __cpp_char8_t >= 201811 use char8_t instead of
char in argument type.
(MessageBuffer::Space): Revert 2025-11-15 change.
(MessageBuffer::Append): For __cpp_char8_t >= 201811 add overload
with char8_t const * type of first argument.
(Packet::Packet): Similarly for first argument.
* client.cc (CommunicationError, Client::ProcessResponse,
Client::Connect, ConnectResponse, PathnameResponse, OKResponse,
IncludeTranslateResponse): Cast u8 string literals to (const char *)
where needed.
* server.cc (Server::ProcessRequests, ConnectRequest): Likewise.
(cherry picked from commit 07a767c7a50d1daae8ef7d4aba73fe53ad40c0b7)
---
libcody/client.cc | 36 +++++++++++++++++++-----------------
libcody/cody.hh | 22 ++++++++++++++++++++++
libcody/server.cc | 28 ++++++++++++++--------------
3 files changed, 55 insertions(+), 31 deletions(-)
--- a/libcody/client.cc
+++ b/libcody/client.cc
@@ -97,7 +97,7 @@ int Client::CommunicateWithServer ()
static Packet CommunicationError (int err)
{
- std::string e {u8"communication error:"};
+ std::string e {(const char *) u8"communication error:"};
e.append (strerror (err));
return Packet (Client::PC_ERROR, std::move (e));
@@ -110,33 +110,34 @@ Packet Client::ProcessResponse (std::vec
{
if (e == EINVAL)
{
- std::string msg (u8"malformed string '");
+ std::string msg ((const char *) u8"malformed string '");
msg.append (words[0]);
- msg.append (u8"'");
+ msg.append ((const char *) u8"'");
return Packet (Client::PC_ERROR, std::move (msg));
}
else
- return Packet (Client::PC_ERROR, u8"missing response");
+ return Packet (Client::PC_ERROR, (const char *) u8"missing response");
}
Assert (!words.empty ());
- if (words[0] == u8"ERROR")
+ if (words[0] == (const char *) u8"ERROR")
return Packet (Client::PC_ERROR,
- words.size () == 2 ? words[1]: u8"malformed error response");
+ words.size () == 2 ? words[1]
+ : (const char *) u8"malformed error response");
if (isLast && !read.IsAtEnd ())
return Packet (Client::PC_ERROR,
- std::string (u8"unexpected extra response"));
+ std::string ((const char *) u8"unexpected extra response"));
Assert (code < Detail::RC_HWM);
Packet result (responseTable[code] (words));
result.SetRequest (code);
if (result.GetCode () == Client::PC_ERROR && result.GetString ().empty ())
{
- std::string msg {u8"malformed response '"};
+ std::string msg {(const char *) u8"malformed response '"};
read.LexedLine (msg);
- msg.append (u8"'");
+ msg.append ((const char *) u8"'");
result.GetString () = std::move (msg);
}
else if (result.GetCode () == Client::PC_CONNECT)
@@ -199,7 +200,7 @@ Packet Client::Connect (char const *agen
size_t alen, size_t ilen)
{
write.BeginLine ();
- write.AppendWord (u8"HELLO");
+ write.AppendWord ((const char *) u8"HELLO");
write.AppendInteger (Version);
write.AppendWord (agent, true, alen);
write.AppendWord (ident, true, ilen);
@@ -211,7 +212,8 @@ Packet Client::Connect (char const *agen
// HELLO $version $agent [$flags]
Packet ConnectResponse (std::vector<std::string> &words)
{
- if (words[0] == u8"HELLO" && (words.size () == 3 || words.size () == 4))
+ if (words[0] == (const char *) u8"HELLO"
+ && (words.size () == 3 || words.size () == 4))
{
char *eptr;
unsigned long val = strtoul (words[1].c_str (), &eptr, 10);
@@ -247,7 +249,7 @@ Packet Client::ModuleRepo ()
// PATHNAME $dir | ERROR
Packet PathnameResponse (std::vector<std::string> &words)
{
- if (words[0] == u8"PATHNAME" && words.size () == 2)
+ if (words[0] == (const char *) u8"PATHNAME" && words.size () == 2)
return Packet (Client::PC_PATHNAME, std::move (words[1]));
return Packet (Client::PC_ERROR, u8"");
@@ -256,7 +258,7 @@ Packet PathnameResponse (std::vector<std
// OK or ERROR
Packet OKResponse (std::vector<std::string> &words)
{
- if (words[0] == u8"OK")
+ if (words[0] == (const char *) u8"OK")
return Packet (Client::PC_OK);
else
return Packet (Client::PC_ERROR,
@@ -319,11 +321,11 @@ Packet Client::IncludeTranslate (char co
// PATHNAME $cmifile
Packet IncludeTranslateResponse (std::vector<std::string> &words)
{
- if (words[0] == u8"BOOL" && words.size () == 2)
+ if (words[0] == (const char *) u8"BOOL" && words.size () == 2)
{
- if (words[1] == u8"FALSE")
- return Packet (Client::PC_BOOL, 0);
- else if (words[1] == u8"TRUE")
+ if (words[1] == (const char *) u8"FALSE")
+ return Packet (Client::PC_BOOL);
+ else if (words[1] == (const char *) u8"TRUE")
return Packet (Client::PC_BOOL, 1);
else
return Packet (Client::PC_ERROR, u8"");
--- a/libcody/cody.hh
+++ b/libcody/cody.hh
@@ -47,12 +47,21 @@ namespace Detail {
// C++11 doesn't have utf8 character literals :(
+#if __cpp_char8_t >= 201811
+template<unsigned I>
+constexpr char S2C (char8_t const (&s)[I])
+{
+ static_assert (I == 2, "only single octet strings may be converted");
+ return s[0];
+}
+#else
template<unsigned I>
constexpr char S2C (char const (&s)[I])
{
static_assert (I == 2, "only single octet strings may be converted");
return s[0];
}
+#endif
/// Internal buffering class. Used to concatenate outgoing messages
/// and Lex incoming ones.
@@ -123,6 +132,13 @@ public:
Space ();
Append (str, maybe_quote, len);
}
+#if __cpp_char8_t >= 201811
+ void AppendWord (char8_t const *str, bool maybe_quote = false,
+ size_t len = ~size_t (0))
+ {
+ AppendWord ((const char *) str, maybe_quote, len);
+ }
+#endif
/// Add a word as with AppendWord
/// @param str the string to append
/// @param maybe_quote string might need quoting, as for Append
@@ -264,6 +280,12 @@ public:
: string (s), cat (STRING), code (c)
{
}
+#if __cpp_char8_t >= 201811
+ Packet (unsigned c, const char8_t *s)
+ : string ((const char *) s), cat (STRING), code (c)
+ {
+ }
+#endif
Packet (unsigned c, std::vector<std::string> &&v)
: vector (std::move (v)), cat (VECTOR), code (c)
{
--- a/libcody/server.cc
+++ b/libcody/server.cc
@@ -36,12 +36,12 @@ static RequestPair
const requestTable[Detail::RC_HWM] =
{
// Same order as enum RequestCode
- RequestPair {u8"HELLO", nullptr},
- RequestPair {u8"MODULE-REPO", ModuleRepoRequest},
- RequestPair {u8"MODULE-EXPORT", ModuleExportRequest},
- RequestPair {u8"MODULE-IMPORT", ModuleImportRequest},
- RequestPair {u8"MODULE-COMPILED", ModuleCompiledRequest},
- RequestPair {u8"INCLUDE-TRANSLATE", IncludeTranslateRequest},
+ RequestPair {(const char *) u8"HELLO", nullptr},
+ RequestPair {(const char *) u8"MODULE-REPO", ModuleRepoRequest},
+ RequestPair {(const char *) u8"MODULE-EXPORT", ModuleExportRequest},
+ RequestPair {(const char *) u8"MODULE-IMPORT", ModuleImportRequest},
+ RequestPair {(const char *) u8"MODULE-COMPILED", ModuleCompiledRequest},
+ RequestPair {(const char *) u8"INCLUDE-TRANSLATE", IncludeTranslateRequest},
};
}
@@ -135,21 +135,21 @@ void Server::ProcessRequests (void)
std::string msg;
if (err > 0)
- msg = u8"error processing '";
+ msg = (const char *) u8"error processing '";
else if (ix >= Detail::RC_HWM)
- msg = u8"unrecognized '";
+ msg = (const char *) u8"unrecognized '";
else if (IsConnected () && ix == Detail::RC_CONNECT)
- msg = u8"already connected '";
+ msg = (const char *) u8"already connected '";
else if (!IsConnected () && ix != Detail::RC_CONNECT)
- msg = u8"not connected '";
+ msg = (const char *) u8"not connected '";
else
- msg = u8"malformed '";
+ msg = (const char *) u8"malformed '";
read.LexedLine (msg);
- msg.append (u8"'");
+ msg.append ((const char *) u8"'");
if (err > 0)
{
- msg.append (u8" ");
+ msg.append ((const char *) u8" ");
msg.append (strerror (err));
}
resolver->ErrorResponse (this, std::move (msg));
@@ -176,7 +176,7 @@ Resolver *ConnectRequest (Server *s, Res
return nullptr;
if (words.size () == 3)
- words.emplace_back (u8"");
+ words.emplace_back ((const char *) u8"");
unsigned version = ParseUnsigned (words[1]);
if (version == ~0u)
return nullptr;
@@ -1,72 +0,0 @@
From: Lars Gierth <larsg@systemli.org>
This patch backports a small but important part of the upstream commit:
b3f1b9e2aa07 build: Remove INCLUDE_MEMORY [PR117737]
Its original commit message fails to mention that the commit also moves
the `#include <memory>` to an earlier position within system.h,
which is the actual change that we're after in this patch.
Building our GCC 14.3 with host GCC 16, the inclusion order starts to matter,
which is an issue that was also touched upon by the upstream commits:
9970b576b7e4 Include safe-ctype.h after C++ standard headers, to avoid over-poisoning
f6e00226a4ca build: Move sstream include above safe-ctype.h {PR117771]
Error log:
> gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/16/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none:amdgcn-amdhsa
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-redhat-linux
Configured with: ../configure --enable-bootstrap --enable-languages=c,c++,fortran,objc,obj-c++,ada,go,d,m2,cobol,algol68,lto --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://bugzilla.redhat.com/ --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-gcc-major-version-only --enable-libstdcxx-backtrace --with-libstdcxx-zoneinfo=/usr/share/zoneinfo --with-linker-hash-style=gnu --enable-plugin --enable-initfini-array --with-isl=/builddir/build/BUILD/gcc-16.0.1-build/gcc-16.0.1-20260321/obj-x86_64-redhat-linux/isl-install --enable-offload-targets=nvptx-none,amdgcn-amdhsa --enable-offload-defaulted --without-cuda-driver --enable-gnu-indirect-function --enable-cet --with-tune=generic --with-tls=gnu2 --with-arch_32=i686 --build=x86_64-redhat-linux --with-build-config=bootstrap-lto --enable-link-serialization=1 --disable-libssp
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 16.0.1 20260321 (Red Hat 16.0.1-0) (GCC)
> git clean -fdx
> make defconfig
> make V=s
[...]
make[5]: Entering directory '/home/user/w/ow/openwrt/build_dir/toolchain-aarch64_cortex-a53_gcc-14.3.0_musl/gcc-14.3.0-initial/gcc'
g++ -fno-PIE -c -DIN_GCC_FRONTEND -O2 -I/home/user/w/ow/openwrt/staging_dir/host/include -pipe -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Wconditionally-supported -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -DHAVE_CONFIG_H -fno-PIE -I. -Ic -I/home/user/w/ow/openwrt/build_dir/toolchain-aarch64_cortex-a53_gcc-14.3.0_musl/gcc-14.3.0/gcc -I/home/user/w/ow/openwrt/build_dir/toolchain-aarch64_cortex-a53_gcc-14.3.0_musl/gcc-14.3.0/gcc/c -I/home/user/w/ow/openwrt/build_dir/toolchain-aarch64_cortex-a53_gcc-14.3.0_musl/gcc-14.3.0/gcc/../include -I/home/user/w/ow/openwrt/build_dir/toolchain-aarch64_cortex-a53_gcc-14.3.0_musl/gcc-14.3.0/gcc/../libcpp/include -I/home/user/w/ow/openwrt/build_dir/toolchain-aarch64_cortex-a53_gcc-14.3.0_musl/gcc-14.3.0/gcc/../libcody -I/home/user/w/ow/openwrt/staging_dir/host/include -I/home/user/w/ow/openwrt/staging_dir/host/include -I/home/user/w/ow/openwrt/staging_dir/host/include -I/home/user/w/ow/openwrt/build_dir/toolchain-aarch64_cortex-a53_gcc-14.3.0_musl/gcc-14.3.0/gcc/../libdecnumber -I/home/user/w/ow/openwrt/build_dir/toolchain-aarch64_cortex-a53_gcc-14.3.0_musl/gcc-14.3.0/gcc/../libdecnumber/dpd -I../libdecnumber -I/home/user/w/ow/openwrt/build_dir/toolchain-aarch64_cortex-a53_gcc-14.3.0_musl/gcc-14.3.0/gcc/../libbacktrace -o c/c-decl.o -MT c/c-decl.o -MMD -MP -MF c/.deps/c-decl.TPo /home/user/w/ow/openwrt/build_dir/toolchain-aarch64_cortex-a53_gcc-14.3.0_musl/gcc-14.3.0/gcc/c/c-decl.cc
In file included from /usr/include/c++/16/bits/basic_ios.h:40,
from /usr/include/c++/16/ios:48,
from /usr/include/c++/16/bits/ostream.h:43,
from /usr/include/c++/16/bits/unique_ptr.h:42,
from /usr/include/c++/16/memory:80,
from /home/user/w/ow/openwrt/build_dir/toolchain-aarch64_cortex-a53_gcc-14.3.0_musl/gcc-14.3.0/gcc/system.h:766,
from /home/user/w/ow/openwrt/build_dir/toolchain-aarch64_cortex-a53_gcc-14.3.0_musl/gcc-14.3.0/gcc/c/c-decl.cc:30:
/usr/include/c++/16/bits/locale_facets.h:252:53: error: macro 'toupper' passed 2 arguments, but takes just 1
252 | toupper(char_type *__lo, const char_type* __hi) const
| ^
[...]
--- a/gcc/system.h
+++ b/gcc/system.h
@@ -222,6 +222,7 @@ extern int fprintf_unlocked (FILE *, con
#ifdef INCLUDE_FUNCTIONAL
# include <functional>
#endif
+# include <memory>
# include <cstring>
# include <initializer_list>
# include <new>
@@ -758,13 +759,6 @@ private:
#define LIKELY(x) (__builtin_expect ((x), 1))
#define UNLIKELY(x) (__builtin_expect ((x), 0))
-/* Some of the headers included by <memory> can use "abort" within a
- namespace, e.g. "_VSTD::abort();", which fails after we use the
- preprocessor to redefine "abort" as "fancy_abort" below. */
-
-#ifdef INCLUDE_MEMORY
-# include <memory>
-#endif
#ifdef INCLUDE_MUTEX
# include <mutex>
+1 -1
View File
@@ -114,7 +114,7 @@ Date: Tue Jul 31 00:52:27 2007 +0000
; On SVR4 targets, it also controls whether or not to emit a
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -10597,6 +10597,17 @@ This option is only supported for C and
@@ -10601,6 +10601,17 @@ This option is only supported for C and
This warning is upgraded to an error by @option{-pedantic-errors}.
@@ -1,250 +0,0 @@
From daa3e1ead791bc58208043cfc4595ba1a78cdd34 Mon Sep 17 00:00:00 2001
From: Jakub Jelinek <jakub@redhat.com>
Date: Fri, 21 Nov 2025 16:25:58 +0100
Subject: [PATCH] libcody: Make it buildable by C++11 to C++26
The following builds with -std=c++11 and c++14 and c++17 and c++20 and c++23
and c++26.
I see the u8 string literals are mixed e.g. with strerror, so in
-fexec-charset=IBM1047 there will still be garbage, so am not 100% sure if
the u8 literals everywhere are worth it either.
2025-11-21 Jakub Jelinek <jakub@redhat.com>
* cody.hh (S2C): For __cpp_char8_t >= 201811 use char8_t instead of
char in argument type.
(MessageBuffer::Space): Revert 2025-11-15 change.
(MessageBuffer::Append): For __cpp_char8_t >= 201811 add overload
with char8_t const * type of first argument.
(Packet::Packet): Similarly for first argument.
* client.cc (CommunicationError, Client::ProcessResponse,
Client::Connect, ConnectResponse, PathnameResponse, OKResponse,
IncludeTranslateResponse): Cast u8 string literals to (const char *)
where needed.
* server.cc (Server::ProcessRequests, ConnectRequest): Likewise.
(cherry picked from commit 07a767c7a50d1daae8ef7d4aba73fe53ad40c0b7)
---
libcody/client.cc | 36 +++++++++++++++++++-----------------
libcody/cody.hh | 22 ++++++++++++++++++++++
libcody/server.cc | 28 ++++++++++++++--------------
3 files changed, 55 insertions(+), 31 deletions(-)
--- a/libcody/client.cc
+++ b/libcody/client.cc
@@ -97,7 +97,7 @@ int Client::CommunicateWithServer ()
static Packet CommunicationError (int err)
{
- std::string e {u8"communication error:"};
+ std::string e {(const char *) u8"communication error:"};
e.append (strerror (err));
return Packet (Client::PC_ERROR, std::move (e));
@@ -110,33 +110,34 @@ Packet Client::ProcessResponse (std::vec
{
if (e == EINVAL)
{
- std::string msg (u8"malformed string '");
+ std::string msg ((const char *) u8"malformed string '");
msg.append (words[0]);
- msg.append (u8"'");
+ msg.append ((const char *) u8"'");
return Packet (Client::PC_ERROR, std::move (msg));
}
else
- return Packet (Client::PC_ERROR, u8"missing response");
+ return Packet (Client::PC_ERROR, (const char *) u8"missing response");
}
Assert (!words.empty ());
- if (words[0] == u8"ERROR")
+ if (words[0] == (const char *) u8"ERROR")
return Packet (Client::PC_ERROR,
- words.size () == 2 ? words[1]: u8"malformed error response");
+ words.size () == 2 ? words[1]
+ : (const char *) u8"malformed error response");
if (isLast && !read.IsAtEnd ())
return Packet (Client::PC_ERROR,
- std::string (u8"unexpected extra response"));
+ std::string ((const char *) u8"unexpected extra response"));
Assert (code < Detail::RC_HWM);
Packet result (responseTable[code] (words));
result.SetRequest (code);
if (result.GetCode () == Client::PC_ERROR && result.GetString ().empty ())
{
- std::string msg {u8"malformed response '"};
+ std::string msg {(const char *) u8"malformed response '"};
read.LexedLine (msg);
- msg.append (u8"'");
+ msg.append ((const char *) u8"'");
result.GetString () = std::move (msg);
}
else if (result.GetCode () == Client::PC_CONNECT)
@@ -199,7 +200,7 @@ Packet Client::Connect (char const *agen
size_t alen, size_t ilen)
{
write.BeginLine ();
- write.AppendWord (u8"HELLO");
+ write.AppendWord ((const char *) u8"HELLO");
write.AppendInteger (Version);
write.AppendWord (agent, true, alen);
write.AppendWord (ident, true, ilen);
@@ -211,7 +212,8 @@ Packet Client::Connect (char const *agen
// HELLO $version $agent [$flags]
Packet ConnectResponse (std::vector<std::string> &words)
{
- if (words[0] == u8"HELLO" && (words.size () == 3 || words.size () == 4))
+ if (words[0] == (const char *) u8"HELLO"
+ && (words.size () == 3 || words.size () == 4))
{
char *eptr;
unsigned long val = strtoul (words[1].c_str (), &eptr, 10);
@@ -247,7 +249,7 @@ Packet Client::ModuleRepo ()
// PATHNAME $dir | ERROR
Packet PathnameResponse (std::vector<std::string> &words)
{
- if (words[0] == u8"PATHNAME" && words.size () == 2)
+ if (words[0] == (const char *) u8"PATHNAME" && words.size () == 2)
return Packet (Client::PC_PATHNAME, std::move (words[1]));
return Packet (Client::PC_ERROR, u8"");
@@ -256,7 +258,7 @@ Packet PathnameResponse (std::vector<std
// OK or ERROR
Packet OKResponse (std::vector<std::string> &words)
{
- if (words[0] == u8"OK")
+ if (words[0] == (const char *) u8"OK")
return Packet (Client::PC_OK);
else
return Packet (Client::PC_ERROR,
@@ -319,11 +321,11 @@ Packet Client::IncludeTranslate (char co
// PATHNAME $cmifile
Packet IncludeTranslateResponse (std::vector<std::string> &words)
{
- if (words[0] == u8"BOOL" && words.size () == 2)
+ if (words[0] == (const char *) u8"BOOL" && words.size () == 2)
{
- if (words[1] == u8"FALSE")
- return Packet (Client::PC_BOOL, 0);
- else if (words[1] == u8"TRUE")
+ if (words[1] == (const char *) u8"FALSE")
+ return Packet (Client::PC_BOOL);
+ else if (words[1] == (const char *) u8"TRUE")
return Packet (Client::PC_BOOL, 1);
else
return Packet (Client::PC_ERROR, u8"");
--- a/libcody/cody.hh
+++ b/libcody/cody.hh
@@ -47,12 +47,21 @@ namespace Detail {
// C++11 doesn't have utf8 character literals :(
+#if __cpp_char8_t >= 201811
+template<unsigned I>
+constexpr char S2C (char8_t const (&s)[I])
+{
+ static_assert (I == 2, "only single octet strings may be converted");
+ return s[0];
+}
+#else
template<unsigned I>
constexpr char S2C (char const (&s)[I])
{
static_assert (I == 2, "only single octet strings may be converted");
return s[0];
}
+#endif
/// Internal buffering class. Used to concatenate outgoing messages
/// and Lex incoming ones.
@@ -123,6 +132,13 @@ public:
Space ();
Append (str, maybe_quote, len);
}
+#if __cpp_char8_t >= 201811
+ void AppendWord (char8_t const *str, bool maybe_quote = false,
+ size_t len = ~size_t (0))
+ {
+ AppendWord ((const char *) str, maybe_quote, len);
+ }
+#endif
/// Add a word as with AppendWord
/// @param str the string to append
/// @param maybe_quote string might need quoting, as for Append
@@ -264,6 +280,12 @@ public:
: string (s), cat (STRING), code (c)
{
}
+#if __cpp_char8_t >= 201811
+ Packet (unsigned c, const char8_t *s)
+ : string ((const char *) s), cat (STRING), code (c)
+ {
+ }
+#endif
Packet (unsigned c, std::vector<std::string> &&v)
: vector (std::move (v)), cat (VECTOR), code (c)
{
--- a/libcody/server.cc
+++ b/libcody/server.cc
@@ -36,12 +36,12 @@ static RequestPair
const requestTable[Detail::RC_HWM] =
{
// Same order as enum RequestCode
- RequestPair {u8"HELLO", nullptr},
- RequestPair {u8"MODULE-REPO", ModuleRepoRequest},
- RequestPair {u8"MODULE-EXPORT", ModuleExportRequest},
- RequestPair {u8"MODULE-IMPORT", ModuleImportRequest},
- RequestPair {u8"MODULE-COMPILED", ModuleCompiledRequest},
- RequestPair {u8"INCLUDE-TRANSLATE", IncludeTranslateRequest},
+ RequestPair {(const char *) u8"HELLO", nullptr},
+ RequestPair {(const char *) u8"MODULE-REPO", ModuleRepoRequest},
+ RequestPair {(const char *) u8"MODULE-EXPORT", ModuleExportRequest},
+ RequestPair {(const char *) u8"MODULE-IMPORT", ModuleImportRequest},
+ RequestPair {(const char *) u8"MODULE-COMPILED", ModuleCompiledRequest},
+ RequestPair {(const char *) u8"INCLUDE-TRANSLATE", IncludeTranslateRequest},
};
}
@@ -135,21 +135,21 @@ void Server::ProcessRequests (void)
std::string msg;
if (err > 0)
- msg = u8"error processing '";
+ msg = (const char *) u8"error processing '";
else if (ix >= Detail::RC_HWM)
- msg = u8"unrecognized '";
+ msg = (const char *) u8"unrecognized '";
else if (IsConnected () && ix == Detail::RC_CONNECT)
- msg = u8"already connected '";
+ msg = (const char *) u8"already connected '";
else if (!IsConnected () && ix != Detail::RC_CONNECT)
- msg = u8"not connected '";
+ msg = (const char *) u8"not connected '";
else
- msg = u8"malformed '";
+ msg = (const char *) u8"malformed '";
read.LexedLine (msg);
- msg.append (u8"'");
+ msg.append ((const char *) u8"'");
if (err > 0)
{
- msg.append (u8" ");
+ msg.append ((const char *) u8" ");
msg.append (strerror (err));
}
resolver->ErrorResponse (this, std::move (msg));
@@ -176,7 +176,7 @@ Resolver *ConnectRequest (Server *s, Res
return nullptr;
if (words.size () == 3)
- words.emplace_back (u8"");
+ words.emplace_back ((const char *) u8"");
unsigned version = ParseUnsigned (words[1]);
if (version == ~0u)
return nullptr;
+3 -3
View File
@@ -8,7 +8,7 @@ Date: Mon Oct 19 23:26:09 2009 +0000
--- a/libgcc/Makefile.in
+++ b/libgcc/Makefile.in
@@ -944,11 +944,12 @@ $(libgcov-driver-objects): %$(objext): $
@@ -945,11 +945,12 @@ $(libgcov-driver-objects): %$(objext): $
# Static libraries.
libgcc.a: $(libgcc-objects)
@@ -22,7 +22,7 @@ Date: Mon Oct 19 23:26:09 2009 +0000
-rm -f $@
objects="$(objects)"; \
@@ -972,7 +973,7 @@ all: libunwind.a
@@ -973,7 +974,7 @@ all: libunwind.a
endif
ifeq ($(enable_shared),yes)
@@ -31,7 +31,7 @@ Date: Mon Oct 19 23:26:09 2009 +0000
ifneq ($(LIBUNWIND),)
all: libunwind$(SHLIB_EXT)
libgcc_s$(SHLIB_EXT): libunwind$(SHLIB_EXT)
@@ -1181,6 +1182,10 @@ install-shared:
@@ -1182,6 +1183,10 @@ install-shared:
chmod 644 $(DESTDIR)$(inst_libdir)/libgcc_eh.a
$(RANLIB) $(DESTDIR)$(inst_libdir)/libgcc_eh.a
+1 -1
View File
@@ -114,7 +114,7 @@ Date: Tue Jul 31 00:52:27 2007 +0000
; On SVR4 targets, it also controls whether or not to emit a
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -10897,6 +10897,17 @@ This option is only supported for C and
@@ -10901,6 +10901,17 @@ This option is only supported for C and
This warning is upgraded to an error by @option{-pedantic-errors}.