diff --git a/.github/workflows/frequent_check.yml b/.github/workflows/frequent_check.yml index 698981d4b..864787395 100644 --- a/.github/workflows/frequent_check.yml +++ b/.github/workflows/frequent_check.yml @@ -91,12 +91,12 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 # https://github.com/marketplace/actions/setup-python with: - python-version: '3.7' + python-version: '3.9' - name: configure run: | mkdir target-Release cd target-Release - cmake .. -DCMAKE_INSTALL_PREFIX=install${{ matrix.os }}CMake-Github -DPYTHON_VERSION=3.7 + cmake .. -DCMAKE_INSTALL_PREFIX=install${{ matrix.os }}CMake-Github -DPYTHON_VERSION=3.9 - name: make run: | cd target-Release diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 286f66990..1debec489 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -94,12 +94,12 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 # https://github.com/marketplace/actions/setup-python with: - python-version: '3.7' + python-version: '3.9' - name: configure run: | mkdir target-Release cd target-Release - cmake -DCMAKE_INSTALL_PREFIX=install${{ matrix.os }}CMake-Github -DPYTHON_VERSION=3.7 .. + cmake -DCMAKE_INSTALL_PREFIX=install${{ matrix.os }}CMake-Github -DPYTHON_VERSION=3.9 .. - name: make run: | cd target-Release diff --git a/CMakeLists.txt b/CMakeLists.txt index 6bd74b735..6cf6bd1b2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,6 +21,10 @@ if (${CMAKE_PROJECT_NAME} STREQUAL nitro) elseif (UNIX) add_compile_options(-Werror) # warnings as errors + if (CMAKE_COMPILER_IS_GNUCC AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 10.0) + add_compile_options(-Wno-error=c++20-compat -Wno-error=format-truncation) + endif() + if (ENABLE_ASAN) # https://gcc.gnu.org/onlinedocs/gcc/Instrumentation-Options.html add_compile_options(-fsanitize=address) diff --git a/modules/python/nitf/samples/nitf_extract.py b/modules/python/nitf/samples/nitf_extract.py index e25e3c1a6..184b91bc5 100755 --- a/modules/python/nitf/samples/nitf_extract.py +++ b/modules/python/nitf/samples/nitf_extract.py @@ -25,7 +25,7 @@ """ from nitf import * -import os, sys, logging, glob +import os, sys, logging, glob, uuid logging.basicConfig(level=logging.INFO, stream=sys.stdout, format='%(asctime)s %(levelname)s %(message)s') @@ -40,7 +40,7 @@ def extract_image(subheader, index, imageReader, outDir=None, baseName=None): bandData = imageReader.read(window) if not outDir: outDir = os.getcwd() - if not baseName: baseName = os.path.basename(os.tempnam()) + if not baseName: baseName = os.path.basename(uuid.uuid4().hex) outNames = [] for band, data in enumerate(bandData): diff --git a/modules/python/nitf/samples/test_image.py b/modules/python/nitf/samples/test_image.py index da3783b6e..7baba84b5 100755 --- a/modules/python/nitf/samples/test_image.py +++ b/modules/python/nitf/samples/test_image.py @@ -25,7 +25,7 @@ """ from nitf import * -import os, sys, logging, glob +import os, sys, logging, glob, uuid from PIL import Image logging.basicConfig(level=logging.INFO, stream=sys.stdout, @@ -41,7 +41,7 @@ def dump_image(subheader, index, imageReader, outDir=None, baseName=None): bandData = imageReader.read(window) if not outDir: outDir = os.getcwd() - if not baseName: baseName = os.path.basename(os.tempnam()) + if not baseName: baseName = os.path.basename(uuid.uuid4().hex) outNames = [] for band, data in enumerate(bandData):