aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorScott Murray <scott.murray@konsulko.com>2021-07-12 15:51:18 -0400
committerScott Murray <scott.murray@konsulko.com>2021-07-12 20:48:08 +0000
commitc5c15f86d2eaaa5ac72f0ac00634a978326daae9 (patch)
treedd23637a7c453c663e3070f67bcfbf1bfd8cdfc8 /src
parent9a8aea1b682f522d7b278312b9bd85ed12fab820 (diff)
Changes for compiling with gcc 11.x: - g++ now seems to instantiate duplicate entries for the set member function in the contextclass template class in binding-wrap.hpp. The use of a closure as a default argument value seems to be the culprit, as it seems there are longstanding issues with respect to using closures like that and resulting symbol names (i.e. the use of a closure isn't necessarily recognized as generating unique instantiations). In theory, C++17 should explicitly allow this when the closure has no captures, but bumping up to -std=gnu++17 did not fix the issue. To avoid it, replace the closure usage with a private static member function. - In afb-hook.c, tweaked the ignoring of the writev return code to make the stricter checking in gcc 11 happy. - In decode_base64 in wrap-json.c, initialize u16 as gcc now seems to miss that it will be initialized on the first loop iteration. Bug-AGL: SPEC-3819 Signed-off-by: Scott Murray <scott.murray@konsulko.com> Change-Id: I8876db196b46cc35ecd2798e20d5ec3425df865e
Diffstat (limited to 'src')
-rw-r--r--src/afb-hook.c2
-rw-r--r--src/wrap-json.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/afb-hook.c b/src/afb-hook.c
index d2ea0b66..9bd480b6 100644
--- a/src/afb-hook.c
+++ b/src/afb-hook.c
@@ -201,7 +201,7 @@ static void _hook_(const char *fmt1, const char *fmt2, va_list arg2, ...)
iov[4].iov_base = (void*)&chars[9];
iov[4].iov_len = 1;
- (void)writev(2, iov, 5);
+ (void)!writev(2, iov, 5);
free(mem1);
free(mem2);
diff --git a/src/wrap-json.c b/src/wrap-json.c
index 6fce73b2..3a764828 100644
--- a/src/wrap-json.c
+++ b/src/wrap-json.c
@@ -200,7 +200,7 @@ static int decode_base64(
size_t *decodedlen,
int url)
{
- uint16_t u16;
+ uint16_t u16 = 0;
uint8_t u8, *result;
size_t in, out, iin;
char c;