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 766761 - Fix non-literal format string warnings for clang
Fix non-literal format string warnings for clang
Status: RESOLVED FIXED
Product: gnome-builder
Classification: Other
Component: libide
3.21.x
Other FreeBSD
: Normal normal
: ---
Assigned To: GNOME Builder Maintainers
GNOME Builder Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-05-22 06:43 UTC by Ting-Wei Lan
Modified: 2016-05-22 14:56 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
libide: Fix non-literal format string warnings for clang (807 bytes, patch)
2016-05-22 06:45 UTC, Ting-Wei Lan
none Details | Review
libide: Fix non-literal format string warnings for clang (876 bytes, patch)
2016-05-22 14:00 UTC, Ting-Wei Lan
committed Details | Review

Description Ting-Wei Lan 2016-05-22 06:43:09 UTC
Please see the attached the patch. It adds a G_GNUC_PRINTF attribute to _ide_build_result_log to fix the problem.

ide-build-result.c:132:41: error: format string is not a string literal [-Werror,-Wformat-nonliteral]
  len = g_vsnprintf (data, sizeof data, format, copy);
                                        ^~~~~~
ide-build-result.c:138:37: error: format string is not a string literal [-Werror,-Wformat-nonliteral]
      g_vsnprintf (freeme, len + 2, format, args);
                                    ^~~~~~
2 errors generated.
Comment 1 Ting-Wei Lan 2016-05-22 06:45:29 UTC
Created attachment 328338 [details] [review]
libide: Fix non-literal format string warnings for clang
Comment 2 Christian Hergert 2016-05-22 09:10:50 UTC
Review of attachment 328338 [details] [review]:

Hrm, looks like that function should have been static too. Mind fixing that as well?
Comment 3 Ting-Wei Lan 2016-05-22 14:00:25 UTC
Created attachment 328342 [details] [review]
libide: Fix non-literal format string warnings for clang

This commit also makes the function static, as it should be.
Comment 4 Christian Hergert 2016-05-22 14:53:36 UTC
Review of attachment 328342 [details] [review]:

LGTM
Comment 5 Ting-Wei Lan 2016-05-22 14:56:10 UTC
Attachment 328342 [details] pushed as 059b179 - libide: Fix non-literal format string warnings for clang