mirror of
https://github.com/yuzu-mirror/mbedtls.git
synced 2025-12-06 07:12:32 +01:00
Fix gcc compile warnings
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
This commit is contained in:
parent
ac3cf7c20b
commit
ba67451562
|
|
@ -130,10 +130,19 @@ void mbedtls_platform_zeroize(void *buf, size_t len)
|
|||
#if defined(__GNUC__)
|
||||
/* For clang and gcc, pretend that we have some assembly that reads the
|
||||
* zero'd memory as an additional protection against being optimised away. */
|
||||
#if defined(__clang__)
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wvla"
|
||||
#elif defined(MBEDTLS_COMPILER_IS_GCC)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wvla"
|
||||
#endif
|
||||
asm volatile ("" : : "m" (*(char (*)[len]) buf) : );
|
||||
#if defined(__clang__)
|
||||
#pragma clang diagnostic pop
|
||||
#elif defined(MBEDTLS_COMPILER_IS_GCC)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue