Quantcast
Channel: How to remove this warning: second parameter of ‘va_start’ not last named argument? - Stack Overflow
Viewing all articles
Browse latest Browse all 5

How to remove this warning: second parameter of ‘va_start’ not last named argument?

$
0
0

I have a function (see below) that is emitting the following warning:

second parameter of ‘va_start’ not last named argument

What does it means and how to remove it?

The function is as the following:

static int  ui_show_warning(GtkWindow *parent, const gchar *fmt, size_t size, ...)    {      GtkWidget *dialog = NULL;      va_list args = NULL;      int count = -1;      char *msg = NULL;      if((msg = malloc(size + 1)) == NULL)        return -12;      va_start(args, fmt);      if((count = snprintf(msg, size, fmt, args)) < 0)        goto outer;      dialog = gtk_message_dialog_new(parent,                      GTK_DIALOG_DESTROY_WITH_PARENT,                      GTK_MESSAGE_WARNING,                      GTK_BUTTONS_OK,"%s", msg);      (void) gtk_dialog_run(GTK_DIALOG(dialog));      gtk_widget_destroy(dialog);     outer: {        if(args != NULL)          va_end(args);        if(msg != NULL)          free(msg);        return count;      }    }

Viewing all articles
Browse latest Browse all 5

Trending Articles