summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2018-10-04 16:21:08 +0200
committerGitHub <noreply@github.com>2018-10-04 16:21:08 +0200
commit3ca2afc09c7a945b8491d8a085203142b2562833 (patch)
treedcdaf258a88f28095009a2632359666f5dc0e1f7
parent181af9b48431a5697056c561c9e2edafc7d738f0 (diff)
parent6bb5ee0ded2cf3914960c17fabf046d43bfb97dd (diff)
Merge pull request #22719 from akien-mga/ci-werror
Travis: Enable 'werror' for X11 and Android builds
-rw-r--r--.travis.yml6
-rw-r--r--core/os/memory.cpp11
2 files changed, 4 insertions, 13 deletions
diff --git a/.travis.yml b/.travis.yml
index 7161a3e029..a5217c1d9c 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -29,7 +29,7 @@ matrix:
- clang-format-6.0
- libstdc++6 # >= 4.9 needed for clang-format-6.0
- - env: PLATFORM=x11 TOOLS=yes TARGET=debug CACHE_NAME=${PLATFORM}-tools-mono-gcc EXTRA_ARGS="module_mono_enabled=yes mono_glue=no"
+ - env: PLATFORM=x11 TOOLS=yes TARGET=debug CACHE_NAME=${PLATFORM}-tools-mono-gcc EXTRA_ARGS="module_mono_enabled=yes mono_glue=no werror=yes"
os: linux
compiler: gcc
addons:
@@ -49,7 +49,7 @@ matrix:
build_command: "scons p=x11 -j2 $OPTIONS"
branch_pattern: coverity_scan
- - env: PLATFORM=x11 TOOLS=no TARGET=release CACHE_NAME=${PLATFORM}-clang
+ - env: PLATFORM=x11 TOOLS=no TARGET=release CACHE_NAME=${PLATFORM}-clang EXTRA_ARGS="werror=yes"
os: linux
compiler: clang
addons:
@@ -57,7 +57,7 @@ matrix:
packages:
- *linux_deps
- - env: PLATFORM=android TOOLS=no TARGET=release_debug CACHE_NAME=${PLATFORM}-clang
+ - env: PLATFORM=android TOOLS=no TARGET=release_debug CACHE_NAME=${PLATFORM}-clang EXTRA_ARGS="werror=yes"
os: linux
compiler: clang
diff --git a/core/os/memory.cpp b/core/os/memory.cpp
index d212efe3cf..f25e40ef78 100644
--- a/core/os/memory.cpp
+++ b/core/os/memory.cpp
@@ -89,17 +89,8 @@ void *Memory::alloc_static(size_t p_bytes, bool p_pad_align) {
atomic_increment(&alloc_count);
if (prepad) {
- // Clang 5 wrongly complains about 's' being unused,
- // while it's used to modify 'mem'.
-#ifdef __clang__
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wunused-variable"
-#endif // __clang__
uint64_t *s = (uint64_t *)mem;
*s = p_bytes;
-#ifdef __clang__
-#pragma clang diagnostic pop
-#endif // __clang__
uint8_t *s8 = (uint8_t *)mem;
@@ -181,9 +172,9 @@ void Memory::free_static(void *p_ptr, bool p_pad_align) {
if (prepad) {
mem -= PAD_ALIGN;
- uint64_t *s = (uint64_t *)mem;
#ifdef DEBUG_ENABLED
+ uint64_t *s = (uint64_t *)mem;
atomic_sub(&mem_usage, *s);
#endif