Skip to content

Commit 6048517

Browse files
author
Daniel Kroening
authored
Merge pull request diffblue#2353 from tautschnig/g++8-fixes2
Work around G++ 8 warnings
2 parents e2e6d82 + 961b29a commit 6048517

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

jbmc/unit/java_bytecode/java_types/erase_type_arguments.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,6 @@ SCENARIO("erase_type_arguments", "[core][java_types]")
6363
REQUIRE_THROWS_AS(
6464
erase_type_arguments(
6565
"testClassName<testTypeArgument1<testTypeArgument2>"),
66-
unsupported_java_class_signature_exceptiont &);
66+
unsupported_java_class_signature_exceptiont);
6767
}
6868
}

src/util/small_map.h

+9-2
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,10 @@ class small_mapt
146146
if(n == 0)
147147
return nullptr;
148148

149-
T *mem = (T *)realloc(ptr, sizeof(T) * n);
149+
// explicitly cast to char * as GCC 8 warns about not using new/delete for
150+
// class sharing_node_innert<dstringt, std::basic_string<char>,
151+
// std::equal_to<dstringt> >
152+
T *mem = (T *)realloc((char *)ptr, sizeof(T) * n);
150153

151154
if(!mem)
152155
throw std::bad_alloc();
@@ -486,7 +489,11 @@ class small_mapt
486489
std::size_t n = size();
487490
if(ii < n - 1)
488491
{
489-
memmove(p + ii, p + ii + 1, sizeof(T) * (n - ii - 1));
492+
// explicitly cast to char * as GCC 8 warns about not using new/delete
493+
// for
494+
// class sharing_node_innert<dstringt, std::basic_string<char>,
495+
// std::equal_to<dstringt> >
496+
memmove((char *)(p + ii), p + ii + 1, sizeof(T) * (n - ii - 1));
490497
}
491498

492499
p = allocate(p, n - 1);

unit/testing-utils/catch.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -2245,7 +2245,7 @@ namespace Catch {
22452245
static_cast<void>(expr); \
22462246
__catchResult.captureResult( Catch::ResultWas::DidntThrowException ); \
22472247
} \
2248-
catch( exceptionType ) { \
2248+
catch( const exceptionType & ) { \
22492249
__catchResult.captureResult( Catch::ResultWas::Ok ); \
22502250
} \
22512251
catch( ... ) { \

0 commit comments

Comments
 (0)