google / benchmark

A microbenchmark support library
Apache License 2.0
8.94k stars 1.62k forks source link

[FR] Strange warning compiler version #1572

Closed HFTrader closed 1 year ago

HFTrader commented 1 year ago

This warning makes no sense to me

CMake Warning at test/AssemblyTests.cmake:6 (message):
  Unsupported Clang version 17.0.0.  Expected is 5.0.0.  Assembly tests may
  be broken.

Looking at the code it says

set(CLANG_SUPPORTED_VERSION "5.0.0")
set(GCC_SUPPORTED_VERSION "5.5.0")

if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
  if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL ${CLANG_SUPPORTED_VERSION})
    message (WARNING
      "Unsupported Clang version " ${CMAKE_CXX_COMPILER_VERSION}
      ". Expected is " ${CLANG_SUPPORTED_VERSION}
      ". Assembly tests may be broken.")
  endif()
elseif(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
  if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL ${GCC_SUPPORTED_VERSION})
    message (WARNING
      "Unsupported GCC version " ${CMAKE_CXX_COMPILER_VERSION}
      ". Expected is " ${GCC_SUPPORTED_VERSION}
      ". Assembly tests may be broken.")
  endif()
else()
  message (WARNING "Unsupported compiler. Assembly tests may be broken.")
endif()

So this will only NOT emit a warning iff VERSION is exactly 5.0.0. Was it meant to say at least 5.0.0?

dmah42 commented 1 year ago

no, it's working as intended. our Assembly Tests rely on specific code generation which requires us to limit the version of the compiler very specifically. @EricWF is the expert here.

HFTrader commented 1 year ago

Seriously? What is the value of a warning that triggers to everyone but a CD/CI robot? Bots don't read warnings. Would consider a range perhaps?

dmah42 commented 1 year ago

that's the point though: the bots should never see the warning because any CI bot running Assembly Tests should have the right version set. any individual trying to run them sees the warning because under any other version of the compiler the tests are extremely unlikely to pass.

HFTrader commented 1 year ago

Understood!