Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix warning related to format-non-iso. #5041

Merged
merged 2 commits into from Apr 4, 2023

Conversation

Jackie9527
Copy link
Contributor

Fix the following warnings when -Wno-format-non-iso is removed.

  In file included from D:\workspace\CODE\assimp\code\AssetLib\glTF\glTFImporter.cpp:45:
  In file included from D:\workspace\CODE\assimp\code\AssetLib/glTF/glTFAsset.h:1012:
D:\workspace\CODE\assimp\code\AssetLib\glTF/glTFAsset.inl(261,36): error : 'I' length modifier is not supported by ISO
C [-Werror,-Wformat-non-iso] [D:\workspace\CODE\assimp\build-msvc-clang\code\assimp.vcxproj]
D:\workspace\CODE\assimp\include\assimp/StringUtils.h(60,22): message : expanded from macro 'AI_SIZEFMT' [D:\workspace\
CODE\assimp\build-msvc-clang\code\assimp.vcxproj]
  In file included from D:\workspace\CODE\assimp\code\AssetLib\glTF\glTFImporter.cpp:45:
  In file included from D:\workspace\CODE\assimp\code\AssetLib/glTF/glTFAsset.h:1012:
D:\workspace\CODE\assimp\code\AssetLib\glTF/glTFAsset.inl(271,36): error : 'I' length modifier is not supported by ISO
C [-Werror,-Wformat-non-iso] [D:\workspace\CODE\assimp\build-msvc-clang\code\assimp.vcxproj]
D:\workspace\CODE\assimp\include\assimp/StringUtils.h(60,22): message : expanded from macro 'AI_SIZEFMT' [D:\workspace\
CODE\assimp\build-msvc-clang\code\assimp.vcxproj]
  In file included from D:\workspace\CODE\assimp\code\AssetLib\glTF\glTFImporter.cpp:45:
  In file included from D:\workspace\CODE\assimp\code\AssetLib/glTF/glTFAsset.h:1012:
D:\workspace\CODE\assimp\code\AssetLib\glTF/glTFAsset.inl(271,51): error : 'I' length modifier is not supported by ISO
C [-Werror,-Wformat-non-iso] [D:\workspace\CODE\assimp\build-msvc-clang\code\assimp.vcxproj]
D:\workspace\CODE\assimp\include\assimp/StringUtils.h(60,22): message : expanded from macro 'AI_SIZEFMT' [D:\workspace\
CODE\assimp\build-msvc-clang\code\assimp.vcxproj]

The build script is as follows:

@echo off
setlocal
set CMAKE_HOME=D:\Tools\cmake-3.26.0-windows-x86_64
set PATH=%CMAKE_HOME%\bin;%PATH%

cmake --version
ninja --version

set SRC=%CD%

set BUILD_ROOT=%SRC%\build-msvc-clang
set BUILD_TARGET=assimp

cmake -B %BUILD_ROOT% ^
    -S %SRC% ^
    -T ClangCl ^
    -DCMAKE_INSTALL_PREFIX=install-clang ^
    -DASSIMP_BUILD_ZLIB=ON ^
    -DASSIMP_BUILD_SAMPLES=ON ^
    -DASSIMP_BUILD_DRACO=OFF ^
    -DBUILD_SHARED_LIBS=ON ^
    -DASSIMP_DOUBLE_PRECISION=OFF ^
    -DASSIMP_BUILD_ASSIMP_TOOLS=ON ^
    -DASSIMP_ASAN=OFF ^
    -DASSIMP_UBSAN=OFF ^
    -DASSIMP_BUILD_TESTS=ON

cmake --build %BUILD_ROOT% --target unit --parallel

Signed-off-by: Jackie9527 <80555200+Jackie9527@users.noreply.github.com>
Copy link
Member

@kimkulling kimkulling left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine.

@kimkulling kimkulling merged commit 17d8e99 into assimp:master Apr 4, 2023
11 checks passed
@kimkulling
Copy link
Member

Merged, thanks for you contribution.

@Jackie9527 Jackie9527 deleted the msvc-clang-format-non-iso branch April 4, 2023 23:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants