SPEC-2513 Fixes to enable w4324 (#1197)

* Fix warning 4324

* warning that doesnt trigger anything

* missed warning
monroegm-disable-blank-issue-2
Esteban Papp 5 years ago committed by GitHub
parent 5bdf9e3c6d
commit 68ffdd6714
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -140,7 +140,10 @@ typedef uint8 byte;
#define STDMETHODCALLTYPE
#endif
#define _ALIGN(num) __attribute__ ((aligned(num)))
#define _ALIGN(num) \
__attribute__ ((aligned(num))) \
AZ_POP_DISABLE_WARNING
#define _PACK __attribute__ ((packed))
// Safe memory freeing

@ -104,7 +104,10 @@ typedef float FLOAT;
#define STDMETHODCALLTYPE
#endif
#define _ALIGN(num) __attribute__ ((aligned(num)))
#define _ALIGN(num) \
__attribute__ ((aligned(num))) \
AZ_POP_DISABLE_WARNING
#define _PACK __attribute__ ((packed))
// Safe memory freeing

@ -111,7 +111,9 @@ int64 CryGetTicksPerSec();
}
#endif
#define _MS_ALIGN(num) __declspec(align(num))
#define _MS_ALIGN(num) \
AZ_PUSH_DISABLE_WARNING(4324, "-Wunknown-warning-option") \
__declspec(align(num))
#define DEFINE_ALIGNED_DATA(type, name, alignment) _declspec(align(alignment)) type name;
#define DEFINE_ALIGNED_DATA_STATIC(type, name, alignment) static _declspec(align(alignment)) type name;

@ -93,7 +93,9 @@ int64 CryGetTicksPerSec();
}
#endif
#define _MS_ALIGN(num) __declspec(align(num))
#define _MS_ALIGN(num) \
AZ_PUSH_DISABLE_WARNING(4324, "-Wunknown-warning-option") \
__declspec(align(num))
#define DEFINE_ALIGNED_DATA(type, name, alignment) _declspec(align(alignment)) type name;
#define DEFINE_ALIGNED_DATA_STATIC(type, name, alignment) static _declspec(align(alignment)) type name;

@ -733,12 +733,12 @@ enum ETriState
// Fallback for Alignment macro of GCC/CLANG (must be after the class definition)
#if !defined(_ALIGN)
#define _ALIGN(num)
#define _ALIGN(num) AZ_POP_DISABLE_WARNING
#endif
// Fallback for Alignment macro of MSVC (must be before the class definition)
#if !defined(_MS_ALIGN)
#define _MS_ALIGN(num)
#define _MS_ALIGN(num) AZ_PUSH_DISABLE_WARNING(4324, "-Wunknown-warning-option")
#endif
#if defined(WIN32) || defined(WIN64)

@ -96,7 +96,12 @@
#endif
/// Aligns a declaration.
# define AZ_ALIGN(_decl, _alignment) __declspec(align(_alignment)) _decl
# define AZ_ALIGN(_decl, _alignment) \
AZ_PUSH_DISABLE_WARNING(4324, "-Wunknown-warning-option") \
__declspec(align(_alignment)) \
_decl \
AZ_POP_DISABLE_WARNING
/// Return the alignment of a type. This if for internal use only (use AZStd::alignment_of<>())
# define AZ_INTERNAL_ALIGNMENT_OF(_type) __alignof(_type)
/// Pointer will be aliased.
@ -123,7 +128,12 @@
# define AZ_FORCE_INLINE inline
/// Aligns a declaration.
# define AZ_ALIGN(_decl, _alignment) _decl __attribute__((aligned(_alignment)))
# define AZ_ALIGN(_decl, _alignment) \
AZ_PUSH_DISABLE_WARNING(4324, "-Wunknown-warning-option") \
_decl \
__attribute__((aligned(_alignment)))
AZ_POP_DISABLE_WARNING
/// Return the alignment of a type. This if for internal use only (use AZStd::alignment_of<>())
# define AZ_INTERNAL_ALIGNMENT_OF(_type) __alignof__(_type)
/// Pointer will be aliased.

@ -180,10 +180,7 @@ namespace AzNetworking
//! Takes a quantized integral value and stores the floating point representation.
void DecodeQuantizedValues();
# if defined AZ_COMPILER_MSVC
# pragma warning(push)
# pragma warning(disable:4201) // anonymous union
# endif
AZ_PUSH_DISABLE_WARNING(4201 4324, "-Wunknown-warning-option") // anonymous union, structure was padded due to alignment
union
{
float m_quantizedValues[NUM_ELEMENTS];
@ -195,9 +192,7 @@ namespace AzNetworking
uint32_t m_serializeValues[NUM_ELEMENTS];
SimdTypei m_serializeVector;
};
# if defined AZ_COMPILER_MSVC
# pragma warning(pop)
# endif
AZ_POP_DISABLE_WARNING
template <AZStd::size_t NUM_ELEMENTS2, AZStd::size_t NUM_BYTES2, int32_t MIN_VALUE2, int32_t MAX_VALUE2>
friend struct QuantizedValuesConversionHelper;

@ -29,7 +29,7 @@ StrEq(const AZStd::string& str)
str, true, true));
}
AZ_PUSH_DISABLE_WARNING(4100, "-Wmissing-declarations") // 'result_listener': unreferenced formal parameter
AZ_PUSH_DISABLE_WARNING(4100 4324, "-Wmissing-declarations") // 'result_listener': unreferenced formal parameter, structure was padded due to alignment specifier
MATCHER(StrEq, "")
{
const auto& lhs = testing::get<0>(arg);

@ -63,12 +63,10 @@ ly_append_configurations_options(
# Disabling these warnings while they get fixed
/wd4018 # signed/unsigned mismatch
/wd4121 # alignment of a member was sensitive to packing
/wd4244 # conversion, possible loss of data
/wd4245 # conversion, signed/unsigned mismatch
/wd4267 # conversion, possible loss of data
/wd4310 # cast truncates constant value
/wd4324 # structure was padded due to alignment specifier
/wd4389 # comparison, signed/unsigned mismatch
# Enabling warnings that are disabled by default from /W4

Loading…
Cancel
Save