diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index ad307b19a499644507163e402cf992bff8b70cf2..261d0b987f6c203e1206531722def34fc79eaf6e 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -55,8 +55,6 @@ check-copyrights:
 ##########################################################
 check-clang-format:
   image: corsika/devel:u-18.04
-  before_script:
-  - apt-get update && apt-get install -y -qq clang-format
   stage: quality
   tags:
     - corsika
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 97e561cf730d17c773e5a467d75a0b40aaaaabc8..82a2b8115df86cde009929b01d5c9b64230d89e1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -93,6 +93,9 @@ endif ()
 if (CMAKE_BUILD_TYPE STREQUAL Coverage)
   find_package (Perl REQUIRED)
 
+  # compile coverage under -O2 to remove unused functions
+  add_compile_options ("-O2")
+  
   set (GCOV gcov CACHE STRING "gcov executable" FORCE)
   set (LCOV_BIN_DIR "${PROJECT_SOURCE_DIR}/ThirdParty/lcov/bin")
   # collect coverage data