validate: fix -Werror=format-nonliteral build with clang

[3470/4053] Compiling C object 'subprojects/gst-devtools/validate/gst/validate/28db7b6@@gstvalidatetracer@sha/gst-validate-reporter.c.o'.
../subprojects/gst-devtools/validate/gst/validate/gst-validate-reporter.c:186:31: warning: format string is not a string literal [-Wformat-nonliteral]
  message = g_strdup_vprintf (format, vacopy);
                              ^~~~~~
[3487/4053] Compiling C object 'subprojects/gst-devtools/validate/gst/validate/28db7b6@@gstvalidatetracer@sha/gst-validate-report.c.o'.
../subprojects/gst-devtools/validate/gst/validate/gst-validate-report.c:1007:34: warning: format string is not a string literal [-Wformat-nonliteral]
  tmp = gst_info_strdup_vprintf (format, args);
                                 ^~~~~~
[76/151] Compiling C object 'subprojects/gst-devtools/validate/plugins/flow/697521d@@gstvalidateflow@sha/gstvalidateflow.c.o'.
../subprojects/gst-devtools/validate/plugins/flow/gstvalidateflow.c:125:65: warning: format string is not a string literal [-Wformat-nonliteral]
  if (!flow->error_writing_file && vfprintf (flow->output_file, format, ap) < 0) {
                                                                ^~~~~~
This commit is contained in:
Matthew Waters 2019-08-26 21:41:00 +10:00
parent b0778d80c6
commit cca6ae3fdb
3 changed files with 10 additions and 2 deletions

View file

@ -277,7 +277,7 @@ void gst_validate_print_action (GstValidateAction *action, const
GST_VALIDATE_API
void gst_validate_printf_valist (gpointer source,
const gchar * format,
va_list args) G_GNUC_NO_INSTRUMENT;
va_list args) G_GNUC_PRINTF (2, 0) G_GNUC_NO_INSTRUMENT;
GST_VALIDATE_API
gboolean gst_validate_report_should_print (GstValidateReport * report);
GST_VALIDATE_API

View file

@ -110,7 +110,7 @@ void gst_validate_report (GstValidateReporter * reporter,
const gchar * format, ...) G_GNUC_PRINTF (3, 4) G_GNUC_NO_INSTRUMENT;
GST_VALIDATE_API
void gst_validate_report_valist (GstValidateReporter * reporter, GstValidateIssueId issue_id,
const gchar * format, va_list var_args);
const gchar * format, va_list var_args) G_GNUC_PRINTF (3, 0);
GST_VALIDATE_API void
gst_validate_reporter_report_simple (GstValidateReporter * reporter, GstValidateIssueId issue_id,
const gchar * message);

View file

@ -117,6 +117,10 @@ validate_flow_override_class_init (ValidateFlowOverrideClass * klass)
GST_VALIDATE_REPORT_LEVEL_CRITICAL));
}
/* *INDENT-OFF* */
G_GNUC_PRINTF (2, 0)
/* *INDENT-ON* */
static void
validate_flow_override_vprintf (ValidateFlowOverride * flow, const char *format,
va_list ap)
@ -130,6 +134,10 @@ validate_flow_override_vprintf (ValidateFlowOverride * flow, const char *format,
g_mutex_unlock (&flow->output_file_mutex);
}
/* *INDENT-OFF* */
G_GNUC_PRINTF (2, 3)
/* *INDENT-ON* */
static void
validate_flow_override_printf (ValidateFlowOverride * flow, const char *format,
...)