Skip to content

[v1.0.3] Sign conversion warnings in qualifier.hpp #1457

Description

@rayment

Issue

When compiling code that directly or indirectly references glm/detail/qualifier.hpp with -Wsign-conversion enabled, the following warnings are produced:

.../glm/detail/qualifier.hpp:88:33: warning: conversion to 'long long unsigned int' from 'int' may change the sign of the result [-Wsign-conversion]
88 | T data[L];
| ^
.../glm/detail/qualifier.hpp:97:41: warning: conversion to 'long long unsigned int' from 'int' may change the sign of the result [-Wsign-conversion]
97 | T data[L];
|

Toolchain

  • OS Name: Microsoft Windows 10 Pro N
  • OS Version: 10.0.19045 Build 19045 AMD64
  • Environment: MinGW 11.0 w64
  • CMake: 4.2.2
  • G++ Version: 13.1.0 (GCC)
  • GLM Version: 1.0.3

Reproduction Code

CMakeLists.txt

cmake_minimum_required(VERSION 4.2)
project(glm_test)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

set(GLM_VERSION 1.0.3)

include(FetchContent)
FetchContent_Declare(
    glm
    URL https://github.com/g-truc/glm/archive/refs/tags/${GLM_VERSION}.tar.gz
    OVERRIDE_FIND_PACKAGE
)
FetchContent_MakeAvailable(glm)

add_executable(glm_test main.cpp)
target_link_libraries(glm_test PRIVATE glm::glm)
target_compile_options(glm_test PRIVATE -Wsign-conversion)

main.cpp

#include <glm/fwd.hpp>

int main() {
    return 0;
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions