Skip to content

Inkscape/kishoredbn/bugfix/1811551 compilation error string literal

Fix: Added string literals for g_strdup_printf(), which was causing compilation error.

Problem: Inkscape fails to build in Mac platform. OS Version: 10.14.2 Revision is 9c2625d5, 2019-01-13 Tool Version: c++/4.2.1 Apple LLVM version 10.0.0 (clang-1000.11.45.5) Target: x86_64-apple-darwin18.2.0

Logs: [ 0%] Built target gc_LIB [ 2%] Built target livarot_LIB [ 4%] Built target nrtype_LIB [ 5%] Built target util_LIB [ 9%] Built target 2geom_LIB [ 10%] Built target uemf_LIB [ 12%] Built target croco_LIB [ 13%] Built target depixelize_LIB [ 16%] Built target avoid_LIB [ 17%] Built target cola_LIB [ 18%] Built target vpsc_LIB [ 20%] Built target autotrace_LIB [ 20%] Generating inkscape-version.cpp revision is 9c2625d5, 2019-01-13 [ 20%] Building CXX object src/CMakeFiles/inkscape_base.dir/preferences.cpp.o /Users/kis~/Workspace/opentree/inkscape/src/preferences.cpp:302:43: error: format string is not a string literal (potentially insecure) [-Werror,-Wformat-security] if (retcode == 0) g_strdup_printf(("Preferences file was deleted.")); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /opt/local/include/glib-2.0/glib/gi18n.h:26:20: note: expanded from macro '' #define (String) gettext (String) ^~~~~~~~~~~~~~~~ /Users/kis~/Workspace/opentree/inkscape/src/preferences.cpp:302:43: note: treat the string as an argument to avoid this if (retcode == 0) g_strdup_printf(("Preferences file was deleted.")); ^ "%s", /opt/local/include/glib-2.0/glib/gi18n.h:26:20: note: expanded from macro '_' #define (String) gettext (String) ^ /Users/kis~/Workspace/opentree/inkscape/src/preferences.cpp:303:24: error: format string is not a string literal (potentially insecure) [-Werror,-Wformat-security] else g_warning(("There was an error trying to delete the preferences file."));

/opt/local/include/glib-2.0/glib/gi18n.h:26:20: note: expanded from macro '_'
#define _(String) gettext (String)
^
/opt/local/include/glib-2.0/glib/gmessages.h:339:32: note: expanded from macro 'g_warning'
**VA_ARGS**)
^~~~~~~~~~~
/Users/kis~/Workspace/opentree/inkscape/src/preferences.cpp:303:24: note: treat the string as an argument to avoid this
else g_warning(_("There was an error trying to delete the preferences file."));
^
"%s",
/opt/local/include/glib-2.0/glib/gi18n.h:26:20: note: expanded from macro '_'
#define _(String) gettext (String)
^
/opt/local/include/glib-2.0/glib/gmessages.h:339:32: note: expanded from macro 'g_warning'
**VA_ARGS**)
^
2 errors generated.
make[2]: *** [src/CMakeFiles/inkscape_base.dir/preferences.cpp.o] Error 1
make[1]: *** [src/CMakeFiles/inkscape_base.dir/all] Error 2
make: *** [all] Error 2

Merge request reports