build: Add -Wall & -Wextra

This commit is contained in:
Juan Ramos 2023-04-04 10:56:59 -06:00 committed by Christophe
parent bedbde277e
commit f82ff63838
2 changed files with 11 additions and 4 deletions

View file

@ -34,6 +34,13 @@ if (VUL_WERROR)
endif()
endif()
if(${CMAKE_CXX_COMPILER_ID} MATCHES "(GNU|Clang)")
add_compile_options(
-Wall
-Wextra
)
endif()
add_subdirectory(src)
add_subdirectory(include)

View file

@ -1,7 +1,7 @@
/*
* Copyright (c) 2015-2023 The Khronos Group Inc.
* Copyright (c) 2015-2023 Valve Corporation
* Copyright (c) 2015-2023 LunarG, Inc.
* Copyright (c) 2023 The Khronos Group Inc.
* Copyright (c) 2023 Valve Corporation
* Copyright (c) 2023 LunarG, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -57,7 +57,7 @@ static std::string format(const char *message, ...) {
std::size_t const STRING_BUFFER(4096);
assert(message != nullptr);
assert(strlen(message) >= 0 && strlen(message) < STRING_BUFFER);
assert(strlen(message) >= 1 && strlen(message) < STRING_BUFFER);
char buffer[STRING_BUFFER];
va_list list;