error: format not a string literal and no format arguments
- From: "Alexander Jones" <alex weej com>
- To: desktop-devel-list <desktop-devel-list gnome org>
- Subject: error: format not a string literal and no format arguments
- Date: Sun, 6 Jul 2008 02:40:48 +0100
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]