diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 156f5989226ca1f52462d9a7af7ed1c678c194b8..123fb93b9469b8325d85d9728bdf55e1273fa800 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -313,9 +313,7 @@ build-codec-linux-make: - .rules-basis script: - *print-common-info - - make -j 2>&1 | tee $BUILD_OUTPUT - # need to use the "|| exit $?" suffix to get the allowed_failure return code, otherwise the job fails with code 1...< - - ci/check_for_warnings.py $BUILD_OUTPUT || exit $? + - make -j build-codec-linux-cmake: extends: @@ -327,9 +325,7 @@ build-codec-linux-cmake: - cd build - cmake .. - cd .. - - make -C build -j 2>&1 | tee $BUILD_OUTPUT - # need to use the "|| exit $?" suffix to get the allowed_failure return code, otherwise the job fails with code 1...< - - ci/check_for_warnings.py $BUILD_OUTPUT || exit $? + - make -C build -j build-codec-instrumented-linux: extends: @@ -348,8 +344,6 @@ build-codec-sanitizers-linux: script: - *print-common-info - bash ci/build_codec_sanitizers_linux.sh - # need to use the "|| exit $?" suffix to get the allowed_failure return code, otherwise the job fails with code 1...< - - ci/check_for_warnings.py $BUILD_OUTPUT || exit $? build-codec-include-split-linux-make: extends: @@ -358,9 +352,7 @@ build-codec-include-split-linux-make: script: - *print-common-info - *enable-split-rendering - - make -j INCLUDE_SPLIT=1 2>&1 | tee $BUILD_OUTPUT - # need to use the "|| exit $?" suffix to get the allowed_failure return code, otherwise the job fails with code 1...< - - ci/check_for_warnings.py $BUILD_OUTPUT || exit $? + - make -j INCLUDE_SPLIT=1 build-codec-include-split-linux-cmake: extends: @@ -373,9 +365,7 @@ build-codec-include-split-linux-cmake: - cd build - cmake .. -DINCLUDE_SPLIT=1 - cd .. - - make -C build -j 2>&1 | tee $BUILD_OUTPUT - # need to use the "|| exit $?" suffix to get the allowed_failure return code, otherwise the job fails with code 1...< - - ci/check_for_warnings.py $BUILD_OUTPUT || exit $? + - make -C build -j build-codec-windows-cmake: extends: @@ -385,10 +375,7 @@ build-codec-windows-cmake: - *print-common-info-windows - $winoutdata = $null - cmake -G "Visual Studio 15 2017" . -Bbuild - - cmake --build build -j | tee -variable winoutdata - - $winoutdata | Out-File $BUILD_OUTPUT -Encoding Utf8 - - ("& python ci/check_for_warnings.py '$BUILD_OUTPUT'") | Invoke-Expression - - ("exit $LASTEXITCODE") | Invoke-Expression + - cmake --build build -j build-codec-windows-include-split-cmake: extends: @@ -401,10 +388,7 @@ build-codec-windows-include-split-cmake: - rm ./lib_com/options.h - mv ./options_patched.h ./lib_com/options.h - cmake -DINCLUDE_SPLIT=1 -G "Visual Studio 15 2017" . -Bbuild - - cmake --build build -j | tee -variable winoutdata - - $winoutdata | Out-File $BUILD_OUTPUT -Encoding Utf8 - - ("& python ci/check_for_warnings.py '$BUILD_OUTPUT'") | Invoke-Expression - - ("exit $LASTEXITCODE") | Invoke-Expression + - cmake --build build -j build-codec-windows-msbuild: extends: @@ -415,9 +399,6 @@ build-codec-windows-msbuild: - $winoutdata = $null - py .\scripts\strip_split_rendering.py - MSBuild.exe .\Workspace_msvc\Workspace_msvc.sln /property:Configuration=Debug | tee -variable winoutdata - - $winoutdata | Out-File $BUILD_OUTPUT -Encoding Utf8 - - ("& python ci/check_for_warnings.py '$BUILD_OUTPUT'") | Invoke-Expression - - ("exit $LASTEXITCODE") | Invoke-Expression # --------------------------------------------------------------- # Test jobs for merge requests @@ -1191,9 +1172,6 @@ test-be-to-release: - echo "$CI_COMMIT_BRANCH" - MSBuild.exe .\Workspace_msvc\Workspace_msvc.sln /property:Configuration=Debug /p:Platform=win32 /m | tee -variable winoutdata - - $winoutdata | Out-File $BUILD_OUTPUT -Encoding Utf8 - - ("& python ci/check_for_warnings.py '$BUILD_OUTPUT'") | Invoke-Expression - - ("exit $LASTEXITCODE") | Invoke-Expression # path to release candidate refs defined in config.toml diff --git a/CMakeLists.txt b/CMakeLists.txt index 08b444139bb6e23c9b17f5a755290a3dbbb2485e..7d8b2caeb056c62a62127c985ca7ea0be020b3e9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -60,7 +60,7 @@ if(UNIX) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ffp-contract=off") # disable floating point operation contraction set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pedantic -Wcast-qual -Wall -W -Wextra -Wno-long-long") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror-implicit-function-declaration -Wno-unused-parameter") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror -Wno-unused-parameter") # CLANG if(CLANG) find_program(clangBin NAMES /home/amm-archiv/soft/Linux/clang/current/bin/clang clang REQUIRED) @@ -112,8 +112,9 @@ elseif(WIN32) -D_CRT_SECURE_NO_WARNINGS /MP ) - # CMake sets /W3 by default, until CMake version 3.15. Instead of setting /W4 separately, replace in existing settings - string(REGEX REPLACE "/W3" "/W4" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") + if(NOT INCLUDE_SPLIT) + add_compile_options("/W4" "/WX") + endif() endif() # configuration options for all platforms diff --git a/Makefile b/Makefile index f7257724963781168e6862587b5a4334865bbe5b..8f5cdaf433c52b568e3f46d3c876a81bd7dd9182 100644 --- a/Makefile +++ b/Makefile @@ -57,7 +57,7 @@ endif # C compiler flags CFLAGS += -std=c99 -pedantic -Wcast-qual -Wall -W -Wextra -Wno-long-long \ -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \ - -Werror-implicit-function-declaration \ + -Werror \ -Wno-implicit-fallthrough -ffp-contract=off # libs to link diff --git a/Workspace_msvc/decoder.vcxproj b/Workspace_msvc/decoder.vcxproj index e59992847c71b085235a5232aad1afa7d710d17f..13e94e853300d33a7baa9e5f406e59c5f2e31b12 100644 --- a/Workspace_msvc/decoder.vcxproj +++ b/Workspace_msvc/decoder.vcxproj @@ -82,6 +82,7 @@ OldStyle Default %(DisableSpecificWarnings) + true _DEBUG;%(PreprocessorDefinitions) @@ -129,6 +130,7 @@ Default %(DisableSpecificWarnings) + true NDEBUG;%(PreprocessorDefinitions) diff --git a/Workspace_msvc/encoder.vcxproj b/Workspace_msvc/encoder.vcxproj index 9578e488dcee1c036524b8520471e228f6cb409f..0808df56360646c30774b4cce9e282cb9636535b 100644 --- a/Workspace_msvc/encoder.vcxproj +++ b/Workspace_msvc/encoder.vcxproj @@ -82,6 +82,7 @@ OldStyle Default %(DisableSpecificWarnings) + true _DEBUG;%(PreprocessorDefinitions) @@ -137,6 +138,7 @@ Default %(DisableSpecificWarnings) + true NDEBUG;%(PreprocessorDefinitions) diff --git a/Workspace_msvc/lib_com.vcxproj b/Workspace_msvc/lib_com.vcxproj index cdf577df2f1c6e9a9e44ae29b846500a4f73689c..92bbedba8eb6c229785b18a3939af892ac34fb74 100644 --- a/Workspace_msvc/lib_com.vcxproj +++ b/Workspace_msvc/lib_com.vcxproj @@ -72,6 +72,7 @@ OldStyle Default %(DisableSpecificWarnings) + true _DEBUG;%(PreprocessorDefinitions) @@ -109,6 +110,7 @@ Default %(DisableSpecificWarnings) + true NDEBUG;%(PreprocessorDefinitions) diff --git a/Workspace_msvc/lib_debug.vcxproj b/Workspace_msvc/lib_debug.vcxproj index 4f3b1aa297341e81d0dbb2cedc16927960a67e26..266fca4507934f13c4a75a89144a8926fb44b4c9 100644 --- a/Workspace_msvc/lib_debug.vcxproj +++ b/Workspace_msvc/lib_debug.vcxproj @@ -68,6 +68,7 @@ OldStyle Default %(DisableSpecificWarnings) + true $(OutDir)$(TargetName).lib @@ -94,6 +95,7 @@ Default %(DisableSpecificWarnings) + true $(OutDir)$(TargetName).lib diff --git a/Workspace_msvc/lib_dec.vcxproj b/Workspace_msvc/lib_dec.vcxproj index 662502a1a614e6e6fb0f171f52f0326b6f301b12..90f7ce7e697d196351a474272e52c079a877a25a 100644 --- a/Workspace_msvc/lib_dec.vcxproj +++ b/Workspace_msvc/lib_dec.vcxproj @@ -82,6 +82,7 @@ OldStyle Default %(DisableSpecificWarnings) + true _DEBUG;%(PreprocessorDefinitions) @@ -124,6 +125,7 @@ Default %(DisableSpecificWarnings) + true NDEBUG;%(PreprocessorDefinitions) @@ -346,4 +348,4 @@ - + \ No newline at end of file diff --git a/Workspace_msvc/lib_enc.vcxproj b/Workspace_msvc/lib_enc.vcxproj index 6ef1fcabe125598f20d9d2982b931c33979dd74e..9763a0c49db159bc0a3ef02d630c694d8f065815 100644 --- a/Workspace_msvc/lib_enc.vcxproj +++ b/Workspace_msvc/lib_enc.vcxproj @@ -82,6 +82,7 @@ OldStyle Default %(DisableSpecificWarnings) + true _DEBUG;%(PreprocessorDefinitions) @@ -128,6 +129,7 @@ Default %(DisableSpecificWarnings) + true NDEBUG;%(PreprocessorDefinitions) @@ -362,4 +364,4 @@ - + \ No newline at end of file diff --git a/Workspace_msvc/lib_lc3plus.vcxproj b/Workspace_msvc/lib_lc3plus.vcxproj index 207b6903c85e91a2662cbe32fcb77fddcc57f416..bb6b4d3c7d1121db5f1cb3ef4dc840a5928684b9 100644 --- a/Workspace_msvc/lib_lc3plus.vcxproj +++ b/Workspace_msvc/lib_lc3plus.vcxproj @@ -72,6 +72,7 @@ 4305;4244;4996 OldStyle false + true Console @@ -90,6 +91,7 @@ true WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) 4244;4305;4996 + true Console diff --git a/Workspace_msvc/lib_rend.vcxproj b/Workspace_msvc/lib_rend.vcxproj index f248ab541afc02ffaef4c7d2d96a132f66eaf949..d0e0d4053fb5367448e4da729f53aad0a70ed2b9 100644 --- a/Workspace_msvc/lib_rend.vcxproj +++ b/Workspace_msvc/lib_rend.vcxproj @@ -82,6 +82,7 @@ OldStyle Default %(DisableSpecificWarnings) + true _DEBUG;%(PreprocessorDefinitions) @@ -124,6 +125,7 @@ Default %(DisableSpecificWarnings) + true NDEBUG;%(PreprocessorDefinitions) diff --git a/Workspace_msvc/lib_util.vcxproj b/Workspace_msvc/lib_util.vcxproj index 4b787f1d0c0d09f2f792da59462aca4c49ee5461..de26f33a6d5671428cc2fddacb4e360db6073376 100644 --- a/Workspace_msvc/lib_util.vcxproj +++ b/Workspace_msvc/lib_util.vcxproj @@ -67,6 +67,7 @@ OldStyle Default %(DisableSpecificWarnings) + true $(OutDir)$(TargetName).lib @@ -90,6 +91,7 @@ Default %(DisableSpecificWarnings) + true $(OutDir)$(TargetName).lib diff --git a/Workspace_msvc/renderer.vcxproj b/Workspace_msvc/renderer.vcxproj index bf4a162d1906de0684b6514f5a2a33330ad29c3f..2bae53b431dbbaac23ad65573f6da7303593a216 100644 --- a/Workspace_msvc/renderer.vcxproj +++ b/Workspace_msvc/renderer.vcxproj @@ -79,6 +79,7 @@ OldStyle Default %(DisableSpecificWarnings) + true _DEBUG;%(PreprocessorDefinitions) @@ -126,6 +127,7 @@ Default %(DisableSpecificWarnings) + true NDEBUG;%(PreprocessorDefinitions) diff --git a/ci/build_codec_sanitizers_linux.sh b/ci/build_codec_sanitizers_linux.sh index 4e40f89b9a028d89363c97ec2fbab109474334b8..d352fa32ec1cd6d8d3283c4984ba428c117b5769 100755 --- a/ci/build_codec_sanitizers_linux.sh +++ b/ci/build_codec_sanitizers_linux.sh @@ -40,5 +40,4 @@ make CLANG=1 -j make clean make CLANG=2 -j make clean -# write out one build for warnings check -make CLANG=3 -j 2>&1 | tee build_output.txt +make CLANG=3 -j diff --git a/ci/check_for_warnings.py b/ci/check_for_warnings.py deleted file mode 100755 index f6b205e689af9ff65bc22cf309c709f6b5ff6d28..0000000000000000000000000000000000000000 --- a/ci/check_for_warnings.py +++ /dev/null @@ -1,62 +0,0 @@ -#!/usr/bin/env python3 -""" - (C) 2022-2023 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB, - Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., - Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, - Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other - contributors to this repository. All Rights Reserved. - - This software is protected by copyright law and by international treaties. - The IVAS codec Public Collaboration consisting of Dolby International AB, Ericsson AB, - Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., - Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, - Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other - contributors to this repository retain full ownership rights in their respective contributions in - the software. This notice grants no license of any kind, including but not limited to patent - license, nor is any license granted by implication, estoppel or otherwise. - - Contributors are required to enter into the IVAS codec Public Collaboration agreement before making - contributions. - - This software is provided "AS IS", without any express or implied warranties. The software is in the - development stage. It is intended exclusively for experts who have experience with such software and - solely for the purpose of inspection. All implied warranties of non-infringement, merchantability - and fitness for a particular purpose are hereby disclaimed and excluded. - - Any dispute, controversy or claim arising under or in relation to providing this software shall be - submitted to and settled by the final, binding jurisdiction of the courts of Munich, Germany in - accordance with the laws of the Federal Republic of Germany excluding its conflict of law rules and - the United Nations Convention on Contracts on the International Sales of Goods. -""" -import argparse -import sys - - -SEARCH_FOR = "warning" -RETURN_FOUND = 123 - - -def main(log_file): - with open(log_file) as f: - lines_with_warnings = [l for l in f.readlines() if SEARCH_FOR in l] - - n_warnings = len(lines_with_warnings) - if n_warnings > 0: - print(f"========== Found {n_warnings} warnings: =========") - for l in lines_with_warnings: - print(l) - return RETURN_FOUND - else: - return 0 - - -if __name__ == "__main__": - parser = argparse.ArgumentParser() - parser.add_argument( - "compilation-output", - type=str, - help="text output of compilation process to analyze", - ) - args = vars(parser.parse_args()) - ret_code = main(args[ "compilation-output" ]) - sys.exit(ret_code)