From: Tom Lane Date: Mon, 13 Dec 2021 16:21:58 +0000 (-0500) Subject: Suppress -Wformat-overflow warnings in 9.2's xml.c. X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3f9700acb238fced605ff3ef155e179290fd4f02;p=thirdparty%2Fpostgresql.git Suppress -Wformat-overflow warnings in 9.2's xml.c. If not using --with-libxml, late-model gcc complains about "'%s' directive argument is null" in places where xml.c passes the result of map_sql_identifier_to_xml_name() to %s. That's not so surprising, because without USE_LIBXML the body of that function is NO_XML_SUPPORT(); return NULL; and before 9.3 the compiler won't understand that NO_XML_SUPPORT() doesn't return. Silence the warnings by returning "" instead. We don't need this hack in later branches, AFAICT. Discussion: https://postgr.es/m/d0316012-ece7-7b7e-2d36-9c38cb77cb3b@enterprisedb.com --- diff --git a/src/backend/utils/adt/xml.c b/src/backend/utils/adt/xml.c index df06d7c37a1..236162d8f55 100644 --- a/src/backend/utils/adt/xml.c +++ b/src/backend/utils/adt/xml.c @@ -1884,7 +1884,7 @@ map_sql_identifier_to_xml_name(char *ident, bool fully_escaped, return buf.data; #else /* not USE_LIBXML */ NO_XML_SUPPORT(); - return NULL; + return ""; #endif /* not USE_LIBXML */ }