diff --git a/.github/workflows/sanitizer.yml b/.github/workflows/sanitizer.yml index 57d6e78f1..b23f4520f 100644 --- a/.github/workflows/sanitizer.yml +++ b/.github/workflows/sanitizer.yml @@ -57,3 +57,13 @@ jobs: - name: test run: cd build/bin && ./unit shell: bash + + job3: + name: printf-sanitizer + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: run scan_printf script + run: ./scripts/scan_printf.sh + shell: bash diff --git a/code/AssetLib/Ogre/OgreXmlSerializer.cpp b/code/AssetLib/Ogre/OgreXmlSerializer.cpp index cd9d6dcc2..a8faaec34 100644 --- a/code/AssetLib/Ogre/OgreXmlSerializer.cpp +++ b/code/AssetLib/Ogre/OgreXmlSerializer.cpp @@ -490,7 +490,7 @@ bool OgreXmlSerializer::ImportSkeleton(Assimp::IOSystem *pIOHandler, MeshXml *me OgreXmlSerializer serializer(xmlParser.get()); XmlNode root = xmlParser->getRootNode(); if (std::string(root.name()) != nnSkeleton) { - printf("\nSkeleton is not a valid root: %s\n", root.name()); + ASSIMP_LOG_VERBOSE_DEBUG("nSkeleton is not a valid root: ", root.name(), "."); for (auto &a : root.children()) { if (std::string(a.name()) == nnSkeleton) { root = a; diff --git a/include/assimp/MemoryIOWrapper.h b/include/assimp/MemoryIOWrapper.h index 77071e96f..1b986ff1b 100644 --- a/include/assimp/MemoryIOWrapper.h +++ b/include/assimp/MemoryIOWrapper.h @@ -150,7 +150,6 @@ public: // ------------------------------------------------------------------- /// @brief Tests for the existence of a file at the given path. bool Exists(const char* pFile) const override { - printf("Exists\n"); if (0 == strncmp( pFile, AI_MEMORYIO_MAGIC_FILENAME, AI_MEMORYIO_MAGIC_FILENAME_LENGTH ) ) { return true; } diff --git a/scripts/scan_printf.sh b/scripts/scan_printf.sh new file mode 100755 index 000000000..f8c902941 --- /dev/null +++ b/scripts/scan_printf.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +grep \ + --include=\*.{c,cpp,h} \ + --exclude={pstdint,m3d}.h \ + -rnw include code \ + -e '^\s*printf' + +if [ $? -eq 0 ]; then + echo "Debug statement(s) detected. Please uncomment (using single-line comment), remove, or manually add to exclude filter, if appropriate" + exit 1 +fi +