tem = value_as_address (value);
if (tem == 0)
{
+ DIAGNOSTIC_PUSH
+ DIAGNOSTIC_IGNORE_FORMAT_NONLITERAL
fprintf_filtered (stream, format, "(null)");
+ DIAGNOSTIC_POP
return;
}
read_memory (tem, str, j);
str[j] = 0;
+ DIAGNOSTIC_PUSH
+ DIAGNOSTIC_IGNORE_FORMAT_NONLITERAL
fprintf_filtered (stream, format, (char *) str);
+ DIAGNOSTIC_POP
}
/* Subroutine of ui_printf to simplify it.
tem = value_as_address (value);
if (tem == 0)
{
+ DIAGNOSTIC_PUSH
+ DIAGNOSTIC_IGNORE_FORMAT_NONLITERAL
fprintf_filtered (stream, format, "(null)");
+ DIAGNOSTIC_POP
return;
}
&output, translit_char);
obstack_grow_str0 (&output, "");
+ DIAGNOSTIC_PUSH
+ DIAGNOSTIC_IGNORE_FORMAT_NONLITERAL
fprintf_filtered (stream, format, obstack_base (&output));
+ DIAGNOSTIC_POP
}
/* Subroutine of ui_printf to simplify it.
*fmt_p++ = 'l';
*fmt_p++ = 'x';
*fmt_p++ = '\0';
+ DIAGNOSTIC_PUSH
+ DIAGNOSTIC_IGNORE_FORMAT_NONLITERAL
fprintf_filtered (stream, fmt, val);
+ DIAGNOSTIC_POP
}
else
{
*fmt_p++ = 's';
*fmt_p++ = '\0';
+ DIAGNOSTIC_PUSH
+ DIAGNOSTIC_IGNORE_FORMAT_NONLITERAL
fprintf_filtered (stream, fmt, "(nil)");
+ DIAGNOSTIC_POP
}
}
&output, translit_char);
obstack_grow_str0 (&output, "");
+ DIAGNOSTIC_PUSH
+ DIAGNOSTIC_IGNORE_FORMAT_NONLITERAL
fprintf_filtered (stream, current_substring,
obstack_base (&output));
+ DIAGNOSTIC_POP
}
break;
case long_long_arg:
{
long long val = value_as_long (val_args[i]);
+ DIAGNOSTIC_PUSH
+ DIAGNOSTIC_IGNORE_FORMAT_NONLITERAL
fprintf_filtered (stream, current_substring, val);
+ DIAGNOSTIC_POP
break;
}
#else
{
int val = value_as_long (val_args[i]);
+ DIAGNOSTIC_PUSH
+ DIAGNOSTIC_IGNORE_FORMAT_NONLITERAL
fprintf_filtered (stream, current_substring, val);
+ DIAGNOSTIC_POP
break;
}
case long_arg:
{
long val = value_as_long (val_args[i]);
+ DIAGNOSTIC_PUSH
+ DIAGNOSTIC_IGNORE_FORMAT_NONLITERAL
fprintf_filtered (stream, current_substring, val);
+ DIAGNOSTIC_POP
break;
}
/* Handles floating-point values. */
have modified GCC to include -Wformat-security by
default, which will warn here if there is no
argument. */
+ DIAGNOSTIC_PUSH
+ DIAGNOSTIC_IGNORE_FORMAT_NONLITERAL
fprintf_filtered (stream, current_substring, 0);
+ DIAGNOSTIC_POP
break;
default:
internal_error (__FILE__, __LINE__,
# define DIAGNOSTIC_IGNORE_SWITCH_DIFFERENT_ENUM_TYPES \
DIAGNOSTIC_IGNORE ("-Wenum-compare-switch")
# endif
+
+# define DIAGNOSTIC_IGNORE_FORMAT_NONLITERAL \
+ DIAGNOSTIC_IGNORE ("-Wformat-nonliteral")
+
#elif defined (__GNUC__) /* GCC */
# define DIAGNOSTIC_IGNORE_UNUSED_FUNCTION \
# define DIAGNOSTIC_IGNORE_STRINGOP_TRUNCATION \
DIAGNOSTIC_IGNORE ("-Wstringop-truncation")
+
+# define DIAGNOSTIC_IGNORE_FORMAT_NONLITERAL \
+ DIAGNOSTIC_IGNORE ("-Wformat-nonliteral")
+
#endif
#ifndef DIAGNOSTIC_IGNORE_SELF_MOVE
# define DIAGNOSTIC_IGNORE_STRINGOP_TRUNCATION
#endif
+#ifndef DIAGNOSTIC_IGNORE_FORMAT_NONLITERAL
+# define DIAGNOSTIC_IGNORE_FORMAT_NONLITERAL
+#endif
+
#endif /* DIAGNOSTICS_H */