Set warnings as errors for the generator, the samples, and the tests.
This commit is contained in:
@@ -13,6 +13,15 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
// ignore warning 4127: conditional expression is constant
|
||||
#if defined( _MSC_VER )
|
||||
# pragma warning( disable : 4127 )
|
||||
#elif defined( __GNUC__ )
|
||||
// don't know how to switch off that warning here
|
||||
#else
|
||||
// unknow compiler... just ignore the warnings for yourselves ;)
|
||||
#endif
|
||||
|
||||
#include "math.hpp"
|
||||
|
||||
namespace vk
|
||||
|
||||
@@ -13,14 +13,18 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
#include <vulkan/vulkan.hpp>
|
||||
#define GLM_FORCE_RADIANS
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#pragma warning( disable : 4201 ) // disable warning C4201: nonstandard extension used: nameless struct/union; needed
|
||||
// to get glm/detail/type_vec?.hpp without warnings
|
||||
#if defined( _MSC_VER )
|
||||
# pragma warning( disable : 4201 ) // disable warning C4201: nonstandard extension used: nameless struct/union; needed
|
||||
// to get glm/detail/type_vec?.hpp without warnings
|
||||
#elif defined( __GNUC__ )
|
||||
// don't know how to switch off that warning here
|
||||
#else
|
||||
// unknow compiler... just ignore the warnings for yourselves ;)
|
||||
#endif
|
||||
|
||||
|
||||
#include <vulkan/vulkan.hpp>
|
||||
|
||||
#define GLM_FORCE_RADIANS
|
||||
#include <glm/gtc/matrix_transform.hpp>
|
||||
|
||||
namespace vk
|
||||
|
||||
@@ -13,6 +13,16 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
#if defined( _MSC_VER )
|
||||
// no need to ignore any warnings with MSVC
|
||||
#elif defined( __clang__ )
|
||||
# pragma clang diagnostic ignored "-Wmissing-braces"
|
||||
#elif defined( __GNUC__ )
|
||||
// no need to ignore any warnings with GCC
|
||||
#else
|
||||
// unknow compiler... just ignore the warnings for yourselves ;)
|
||||
#endif
|
||||
|
||||
#include "utils.hpp"
|
||||
|
||||
#include "vulkan/vulkan.hpp"
|
||||
@@ -521,7 +531,7 @@ namespace vk
|
||||
}
|
||||
typeBits >>= 1;
|
||||
}
|
||||
assert( typeIndex != ~0 );
|
||||
assert( typeIndex != uint32_t(~0) );
|
||||
return typeIndex;
|
||||
}
|
||||
|
||||
@@ -1046,7 +1056,6 @@ namespace vk
|
||||
bool forceStaging )
|
||||
: format( vk::Format::eR8G8B8A8Unorm ), extent( extent_ )
|
||||
{
|
||||
vk::PhysicalDeviceMemoryProperties memoryProperties = physicalDevice.getMemoryProperties();
|
||||
vk::FormatProperties formatProperties = physicalDevice.getFormatProperties( format );
|
||||
|
||||
formatFeatureFlags |= vk::FormatFeatureFlagBits::eSampledImage;
|
||||
|
||||
@@ -343,8 +343,10 @@ namespace vk
|
||||
VULKAN_HPP_INLINE TargetType checked_cast( SourceType value )
|
||||
{
|
||||
static_assert( sizeof( TargetType ) <= sizeof( SourceType ), "No need to cast from smaller to larger type!" );
|
||||
static_assert( !std::numeric_limits<TargetType>::is_signed, "Only unsigned types supported!" );
|
||||
static_assert( std::numeric_limits<SourceType>::is_integer, "Only integer types supported!" );
|
||||
static_assert( !std::numeric_limits<SourceType>::is_signed, "Only unsigned types supported!" );
|
||||
static_assert( std::numeric_limits<TargetType>::is_integer, "Only integer types supported!" );
|
||||
static_assert( !std::numeric_limits<TargetType>::is_signed, "Only unsigned types supported!" );
|
||||
assert( value <= std::numeric_limits<TargetType>::max() );
|
||||
return static_cast<TargetType>( value );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user