Fix new warnings with GCC13

This commit is contained in:
Patrick Pelissier committed 2023-05-13 00:52:06 +02:00
1 parent b487bfe5ad
commit b6046e5e23
2 files changed
+16 -1

No files matched your search

+1 -1
View File
@@ -201,7 +201,7 @@ static void test_rp_basic(void)
{
rpdict1_t dict;
rpdict1_init(dict);
int z;
int z = 0;
rpdict1_set_at(dict, 2, 3);
rpdict1_get_copy(&z, dict, 2);
assert (z == 3);
+15
View File
@@ -399,9 +399,24 @@ static void test3(void)
assert(flow ++ == 0);
M_TRY(test1) {
assert(flow ++ == 1);
#ifdef __GNUC__
#if __GNUC__ >= 13
/* Issue with GCC 13. It reports a variable as being not initialized
whereas it is obviously initialized.
See also https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109530
*/
_Pragma("GCC diagnostic push")
_Pragma("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
#endif
#endif
M_DEFER( assert(flow++ == 3) ) {
assert(flow ++ == 2);
}
#ifdef __GNUC__
#if __GNUC__ >= 13
_Pragma("GCC diagnostic pop")
#endif
#endif
} M_CATCH(test1, M_ERROR_MEMORY) {
assert(0);
}