Cleaner implementation of MBEDTLS_IGNORE_RETURN

The previous implementation was misparsed in constructs like
`if (condition) MBEDTLS_IGNORE_RETURN(...); else ...;`.

Implement it as an expression, tested with GCC, Clang and MSVC.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
diff --git a/include/mbedtls/platform_util.h b/include/mbedtls/platform_util.h
index 0882dc6..d632eed 100644
--- a/include/mbedtls/platform_util.h
+++ b/include/mbedtls/platform_util.h
@@ -133,8 +133,15 @@
  *
  * Silences warning about unused return value given by functions
  * with \c MBEDTLS_CHECK_RETURN attribute.
+/* GCC doesn't silence the warning with just (void)(result).
+ * !(void)(result) is known to work up at least up to GCC 10, as well
+ * as with Clang and MSVC.
+ *
+ * https://gcc.gnu.org/onlinedocs/gcc-3.4.6/gcc/Non_002dbugs.html
+ * https://stackoverflow.com/questions/40576003/ignoring-warning-wunused-result
+ * https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66425#c34
  */
-#define MBEDTLS_IGNORE_RETURN(result) if( result ) {}
+#define MBEDTLS_IGNORE_RETURN(result) ( (void) !( result ) )
 
 /**
  * \brief       Securely zeroize a buffer