Push -Wno-error=deprecated-declarations from C*_FLAGS down to the target

This commit is contained in:
Richard Cohen
2023-03-12 17:58:53 +00:00
parent 1f0a69a804
commit 30586ac3e6
3 changed files with 9 additions and 4 deletions

View File

@@ -372,12 +372,17 @@ GncXmlBackend::write_to_file (bool make_backup)
strcpy (tmp_name, m_fullpath.c_str());
strcat (tmp_name, ".tmp-XXXXXX");
/* Clang static analyzer flags this as a security risk, which is
/* Clang static analyzer and GNU ld flag mktemp as a security risk, which is
* theoretically true, but we can't use mkstemp because we need to
* open the file ourselves because of compression. None of the alternatives
* is any more secure.
*
* Xcode marks mktemp as deprecated
*/
#pragma GCC diagnostic push
#pragma GCC diagnostic warning "-Wdeprecated-declarations"
if (!mktemp (tmp_name))
#pragma GCC diagnostic pop
{
g_free (tmp_name);
set_error(ERR_BACKEND_MISC);