error: format not a string literal and no format arguments



I'm trying to build Rhythmbox...

With gcc 4.3 (from Ubuntu 8.10), I'm getting this error in a
helluvalot of places:

"error: format not a string literal and no format arguments"

The problem lies in code like this:

char* error = NULL;
...
g_warning(error)

You have to use, e.g.:
g_warning ("%s", error);
for macros like g_warning and g_log, and any API function that
actually accepts a printf-format (like g_error_set) while we're
passing it any old string without any parameters.

Yeah, I could just use -Wleave-me-alone-ffs or something, but it's
probably worth considering this properly.

"Discuss."

Alex


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