GNOME Bugzilla – Bug 710621
utils: Uses non-literal as format string
Last modified: 2014-05-23 10:58:02 UTC
The current git master fails to build on Mac OSX since the update to the new clang compiler (5.0). my system: OS X: 10.8.4-x86_64 Xcode: 5.0 LLVM-GCC: build 2336 Clang: 5.0 build 500 the error: gstutils.c:3659:41: error: format string is not a string literal [-Werror,-Wformat-nonliteral] gchar *expanded = g_strdup_vprintf (stream_id, var_args); ^~~~~~~~~ 1 error generated. What is the best way to solve this issue? (without disabling -Werror for Mac OSX)
This should fix it. Please test :) commit 7e5dc030f5e39998169166a8b1a734f3bf7efc62 Author: Sebastian Dröge <sebastian@centricular.com> Date: Wed Oct 30 21:53:36 2013 +0100 utils: Add some attributes and reorganize code to fix compiler warnings gstutils.c:3659:41: error: format string is not a string literal [-Werror,-Wformat-nonliteral] gchar *expanded = g_strdup_vprintf (stream_id, var_args); https://bugzilla.gnome.org/show_bug.cgi?id=710621
That part is fixed, but there are some more. A similar like the one mentioned above is fixed by adding $(PRINTF_CFLAGS) in the makefile, is this acceptable? I created a github branch where the build passes with xcode 5.0: https://github.com/lovebug356/gstreamer/tree/fix_mac
Could you attach the patches here for better review? The GstMemory changes look good, -Qunused-arguments looks like something that other compilers might not like (so needs at least a configure check, better another workaround... like the unused compiler attribute... G_GNUC_UNUSED). For the tools, ideally we can fix that without the $(PRINTF_CFLAGS) thing but otherwise that's fine too.
Thijs, any news on this? The 1.2 branch built fine for me with latest XCode and OSX Mavericks on Friday btw
Didn't have time too look at improving the patches yet. But I still need patches when building gstreamer (commit ebca6aa84f) fyi, I'm building with homebrew and jhbuild.
Is this still a problem? Alessandro pushed some related changes for this recently
No, this is still the case. I need the following patches for gstreamer core.
Created attachment 260251 [details] [review] tools xcode 5
Created attachment 260252 [details] [review] tests xcode 5
Review of attachment 260252 [details] [review]: I'm ready to bet gcc won't like -Qunusued-arguments, so it probably needs to be added using some configure test.
Or putting some G_GNUC_UNUSED in the places where it is causing a warning
Anybody planning to work on this?
Thijs, the jenkins slaves are running on maverick with xcode 5.1, and there are no more issues. Can you confirm everything is fine with current git ?
I'm switched to using gcc-4.7 (build with homebrew) for jhbuild on mac. So I'm not experiencing the problem anymore. Maybe better to close for now and re-open later if needed...
Let's assume it's fixed. If it's still an issue, someone will file a new bug sooner or later, thanks!