Skip to content
Extraits de code Groupes Projets
Valider 509274da rédigé par Elliu's avatar Elliu
Parcourir les fichiers

Silence warnings: add -Wno-unsafe-buffer-usage for Clang

parent 3202d747
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -146,6 +146,11 @@ if (${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang") ...@@ -146,6 +146,11 @@ if (${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
-Wno-global-constructors -Wno-global-constructors
-Wno-exit-time-destructors -Wno-exit-time-destructors
) )
if (${CMAKE_CXX_COMPILER_VERSION} VERSION_GREATER 16)
target_compile_options(Vivy PRIVATE
-Wno-unsafe-buffer-usage
)
endif()
elseif (${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU") elseif (${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
target_compile_options(Vivy PRIVATE target_compile_options(Vivy PRIVATE
-Wno-subobject-linkage # Kubat: Some proglems here, it seems they -Wno-subobject-linkage # Kubat: Some proglems here, it seems they
......
...@@ -277,12 +277,14 @@ LogMessage::operator<<(const std::string_view strv) noexcept ...@@ -277,12 +277,14 @@ LogMessage::operator<<(const std::string_view strv) noexcept
LogMessage & LogMessage &
LogMessage::operator<<(const char *str) noexcept LogMessage::operator<<(const char *str) noexcept
{ {
const std::size_t length = strlen(str); if (str){
for (std::size_t i = 0; (i < length) && (indexInArray < messageBufferLength - 1); const std::size_t length = strlen(str);
++i, ++indexInArray) { for (std::size_t i = 0; (i < length) && (indexInArray < messageBufferLength - 1);
textBuffer[indexInArray] = str[i]; ++i, ++indexInArray) {
textBuffer[indexInArray] = str[i];
}
textBuffer[indexInArray] = '\0';
} }
textBuffer[indexInArray] = '\0';
return *this; return *this;
} }
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter