After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 710621 - utils: Uses non-literal as format string
utils: Uses non-literal as format string
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other Mac OS
: Normal normal
: 1.3.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2013-10-22 09:54 UTC by Thijs Vermeir
Modified: 2014-05-23 10:58 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
tools xcode 5 (817 bytes, patch)
2013-11-19 15:40 UTC, Thijs Vermeir
none Details | Review
tests xcode 5 (1.53 KB, patch)
2013-11-19 15:41 UTC, Thijs Vermeir
needs-work Details | Review

Description Thijs Vermeir 2013-10-22 09:54:27 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)
Comment 1 Sebastian Dröge (slomo) 2013-10-30 20:55:06 UTC
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
Comment 2 Thijs Vermeir 2013-10-30 23:10:57 UTC
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
Comment 3 Sebastian Dröge (slomo) 2013-10-31 10:46:00 UTC
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.
Comment 4 Sebastian Dröge (slomo) 2013-11-04 09:56:35 UTC
Thijs, any news on this? The 1.2 branch built fine for me with latest XCode and OSX Mavericks on Friday btw
Comment 5 Thijs Vermeir 2013-11-04 10:19:40 UTC
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.
Comment 6 Sebastian Dröge (slomo) 2013-11-11 12:31:43 UTC
Is this still a problem? Alessandro pushed some related changes for this recently
Comment 7 Thijs Vermeir 2013-11-19 15:39:59 UTC
No, this is still the case. I need the following patches for gstreamer core.
Comment 8 Thijs Vermeir 2013-11-19 15:40:48 UTC
Created attachment 260251 [details] [review]
tools xcode 5
Comment 9 Thijs Vermeir 2013-11-19 15:41:11 UTC
Created attachment 260252 [details] [review]
tests xcode 5
Comment 10 Olivier Crête 2013-11-19 16:08:39 UTC
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.
Comment 11 Sebastian Dröge (slomo) 2013-11-19 19:23:05 UTC
Or putting some G_GNUC_UNUSED in the places where it is causing a warning
Comment 12 Sebastian Dröge (slomo) 2014-01-01 13:24:11 UTC
Anybody planning to work on this?
Comment 13 Edward Hervey 2014-05-22 15:02:08 UTC
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 ?
Comment 14 Thijs Vermeir 2014-05-23 10:41:48 UTC
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...
Comment 15 Tim-Philipp Müller 2014-05-23 10:58:02 UTC
Let's assume it's fixed. If it's still an issue, someone will file a new bug sooner or later, thanks!