Compiler error with g_string{_append}_printf



I've come across something that has me baffled - it may be obvious, but
I've fooled with this and can't see what's wrong..

I get an error stating "void value not ignored as it ought to be" in the
g_string_append_printf line.  From what I could gather on Google, this
usually happens when a void value (usually returned from a function) is
passed as a parameter to a function. In fact, in this case, they are ALL
constant string pointers.

I use g_string_append_printf and these compile correctly, so I doubt if
it's a bug in glib.

Here's the code snippet ..

static void
hlp_about (GtkAction * action, glbls * hbuf)
{
    GtkWidget *dialog;
    GString *msg;

/* I believe NULL is valid.. irregardless.. I've tried using a string to
 * no avail */
 
    msg = g_string_new (NULL);

/* The below doesn't work with g_string_printf, either */
/* I've tried breaking the below apart into at least two different
 * appends, but still no go. */

    msg = g_string_append_printf (msg, "  -- G09Dis V %s --\n\n%s\n%s", "2.0",
                       "  A graphical front-end to \"os9disasm\"\n",
                       "  This version is strictly BETA!!!");

Actually, I got around the problem by using g_strconcat, but I'd just
like to know where the problem lies.  As I said, it may be something
staring me in the face, but I can't see it at all.  



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]