From 93b9b18b5096c7591c02036e1c908f3bcbb09f29 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Wed, 9 Mar 2011 14:12:09 +0100 Subject: add -Wwrite-strings everywhere Signed-off-by: Denys Vlasenko --- src/applet/Makefile.am | 4 ++-- src/btparser/Makefile.am | 2 +- src/cli/Makefile.am | 2 +- src/daemon/Makefile.am | 8 ++++---- src/gui-gtk/Makefile.am | 4 ++-- src/gui-wizard-gtk/Makefile.am | 2 +- src/gui-wizard-gtk/wizard.c | 2 +- src/hooks/Makefile.am | 2 +- src/hooks/abrt-hook-ccpp.c | 2 +- src/lib/Makefile.am | 6 +++--- src/plugins/Makefile.am | 26 +++++++++++++------------- src/report-python/Makefile.am | 2 +- src/report-python/dump_dir.c | 2 +- src/report-python/reportmodule.c | 2 +- src/report-python/run_event.c | 8 ++++---- 15 files changed, 37 insertions(+), 37 deletions(-) diff --git a/src/applet/Makefile.am b/src/applet/Makefile.am index cd4a643f..4756f312 100644 --- a/src/applet/Makefile.am +++ b/src/applet/Makefile.am @@ -17,7 +17,7 @@ abrt_applet_CPPFLAGS = \ $(GTK_CFLAGS) \ $(DBUS_CFLAGS) \ -D_GNU_SOURCE \ - -Wall -Werror + -Wall -Wwrite-strings -Werror # -I/usr/include/glib-2.0 # -I/usr/lib/glib-2.0/include # $(LIBNOTIFY_CFLAGS) @@ -37,7 +37,7 @@ abrt_applet_LDADD = \ # -I$(srcdir)/../include/report -I$(srcdir)/../include \ # $(GLIB_CFLAGS) \ # -D_GNU_SOURCE \ -# -Wall -Werror +# -Wall -Wwrite-strings -Werror #test_report_LDADD = \ # ../lib/libreport.la diff --git a/src/btparser/Makefile.am b/src/btparser/Makefile.am index 9f64f826..030d94da 100644 --- a/src/btparser/Makefile.am +++ b/src/btparser/Makefile.am @@ -13,7 +13,7 @@ libbtparser_la_SOURCES = \ normalize_xorg.c \ thread.h thread.c \ utils.h utils.c -libbtparser_la_CFLAGS = -Wall -Werror -D_GNU_SOURCE -I../lib +libbtparser_la_CFLAGS = -Wall -Wwrite-strings -Werror -D_GNU_SOURCE -I../lib libbtparser_la_LDFLAGS = -version-info 1:1:0 libbtparser_la_LIBADD = ../lib/libreport.la diff --git a/src/cli/Makefile.am b/src/cli/Makefile.am index 0a5c6e1a..345598d0 100644 --- a/src/cli/Makefile.am +++ b/src/cli/Makefile.am @@ -13,7 +13,7 @@ abrt_cli_CPPFLAGS = \ $(ENABLE_SOCKET_OR_DBUS) \ $(DBUS_CFLAGS) $(GLIB_CFLAGS) \ -D_GNU_SOURCE \ - -Wall -Werror + -Wall -Wwrite-strings -Werror # $(GTK_CFLAGS) abrt_cli_LDADD = \ ../lib/libreport.la \ diff --git a/src/daemon/Makefile.am b/src/daemon/Makefile.am index 6fe73065..4c48ceb9 100644 --- a/src/daemon/Makefile.am +++ b/src/daemon/Makefile.am @@ -30,7 +30,7 @@ abrtd_CPPFLAGS = \ $(DBUS_CFLAGS) \ $(ENABLE_SOCKET_OR_DBUS) \ -D_GNU_SOURCE \ - -Wall + -Wall -Wwrite-strings abrtd_LDADD = \ $(DL_LIBS) \ $(DBUS_LIBS) \ @@ -51,7 +51,7 @@ abrt_server_CPPFLAGS = \ -DPLUGINS_CONF_DIR=\"$(PLUGINS_CONF_DIR)\" \ $(GLIB_CFLAGS) \ -D_GNU_SOURCE \ - -Wall -Werror + -Wall -Wwrite-strings -Werror abrt_server_LDADD = \ ../lib/libreport.la @@ -71,7 +71,7 @@ abrt_handle_crashdump_CPPFLAGS = \ -DLIBEXEC_DIR=\"$(LIBEXEC_DIR)\" \ $(GLIB_CFLAGS) \ -D_GNU_SOURCE \ - -Wall -Werror + -Wall -Wwrite-strings -Werror abrt_handle_crashdump_LDADD = \ ../lib/libreport.la @@ -92,7 +92,7 @@ abrt_action_save_package_data_CPPFLAGS = \ -DPLUGINS_CONF_DIR=\"$(PLUGINS_CONF_DIR)\" \ $(GLIB_CFLAGS) \ -D_GNU_SOURCE \ - -Wall -Werror + -Wall -Wwrite-strings -Werror abrt_action_save_package_data_LDADD = \ $(RPM_LIBS) \ ../lib/libreport.la diff --git a/src/gui-gtk/Makefile.am b/src/gui-gtk/Makefile.am index 31cae91e..64754080 100644 --- a/src/gui-gtk/Makefile.am +++ b/src/gui-gtk/Makefile.am @@ -17,7 +17,7 @@ abrt_gtk_CFLAGS = \ $(GTK_CFLAGS) \ $(DBUS_CFLAGS) \ -D_GNU_SOURCE \ - -Wall -Werror + -Wall -Wwrite-strings -Werror # -I/usr/include/glib-2.0 # -I/usr/lib/glib-2.0/include # $(LIBNOTIFY_CFLAGS) @@ -37,7 +37,7 @@ abrt_gtk_LDADD = \ # -I$(srcdir)/../include/report -I$(srcdir)/../include \ # $(GLIB_CFLAGS) \ # -D_GNU_SOURCE \ -# -Wall -Werror +# -Wall -Wwrite-strings -Werror #test_report_LDADD = \ # ../lib/libreport.la diff --git a/src/gui-wizard-gtk/Makefile.am b/src/gui-wizard-gtk/Makefile.am index 4281c470..a44de58c 100644 --- a/src/gui-wizard-gtk/Makefile.am +++ b/src/gui-wizard-gtk/Makefile.am @@ -24,7 +24,7 @@ bug_reporting_wizard_CFLAGS = \ $(GTK_CFLAGS) \ $(DBUS_CFLAGS) \ -D_GNU_SOURCE \ - -Wall -Werror + -Wall -Wwrite-strings -Werror # Required for gtk_builder_connect_signals() to work correctly: # -lgmodule-2.0 diff --git a/src/gui-wizard-gtk/wizard.c b/src/gui-wizard-gtk/wizard.c index 30e60a13..1845787e 100644 --- a/src/gui-wizard-gtk/wizard.c +++ b/src/gui-wizard-gtk/wizard.c @@ -347,7 +347,7 @@ static void tv_details_edit_cb(GtkTreeView *tree_view, return; gchar *arg[3]; - arg[0] = "xdg-open"; + arg[0] = (char *) "xdg-open"; arg[1] = concat_path_file(g_dump_dir_name, column_name); arg[2] = NULL; g_free(column_name); diff --git a/src/hooks/Makefile.am b/src/hooks/Makefile.am index 8d7cec50..66951f0f 100644 --- a/src/hooks/Makefile.am +++ b/src/hooks/Makefile.am @@ -11,7 +11,7 @@ abrt_hook_ccpp_CPPFLAGS = \ -DVAR_RUN=\"$(VAR_RUN)\" \ -DPLUGINS_CONF_DIR=\"$(PLUGINS_CONF_DIR)\" \ $(GLIB_CFLAGS) \ - -Wall \ + -Wall -Wwrite-strings \ -D_GNU_SOURCE abrt_hook_ccpp_LDADD = \ ../lib/libreport.la diff --git a/src/hooks/abrt-hook-ccpp.c b/src/hooks/abrt-hook-ccpp.c index 7f2d9f55..c2ab166f 100644 --- a/src/hooks/abrt-hook-ccpp.c +++ b/src/hooks/abrt-hook-ccpp.c @@ -174,7 +174,7 @@ static char* get_cwd(pid_t pid) */ /* Must match CORE_PATTERN order in daemon! */ static const char percent_specifiers[] = "%scpugthe"; -static char *core_basename = "core"; +static char *core_basename = (char*) "core"; static int open_user_core(const char *user_pwd, uid_t uid, pid_t pid, char **percent_values) { diff --git a/src/lib/Makefile.am b/src/lib/Makefile.am index 863a0448..36fe7b4b 100644 --- a/src/lib/Makefile.am +++ b/src/lib/Makefile.am @@ -47,7 +47,7 @@ libreport_la_SOURCES = \ event_xml_parser.c \ event_config.c libreport_la_CPPFLAGS = \ - -Wall -Werror \ + -Wall -Wwrite-strings -Werror \ -I$(srcdir)/../include/report -I$(srcdir)/../include \ -DLOCALSTATEDIR='"$(localstatedir)"' \ -DVAR_RUN=\"$(VAR_RUN)\" \ @@ -76,7 +76,7 @@ libabrt_dbus_la_CPPFLAGS = \ -DEVENTS_DIR=\"$(EVENTS_DIR)\" \ $(GLIB_CFLAGS) \ $(DBUS_CFLAGS) \ - -Wall -Werror \ + -Wall -Wwrite-strings -Werror \ -D_GNU_SOURCE libabrt_dbus_la_LDFLAGS = \ -version-info 0:1:0 @@ -88,7 +88,7 @@ libabrt_web_la_SOURCES = \ abrt_curl.h abrt_curl.c \ abrt_xmlrpc.h abrt_xmlrpc.cpp libabrt_web_la_CPPFLAGS = \ - -Wall -Werror \ + -Wall -Wwrite-strings -Werror \ -I$(srcdir)/../include/report -I$(srcdir)/../include \ -DLOCALSTATEDIR='"$(localstatedir)"' \ -DVAR_RUN=\"$(VAR_RUN)\" \ diff --git a/src/plugins/Makefile.am b/src/plugins/Makefile.am index 0a409463..3c4b37cf 100644 --- a/src/plugins/Makefile.am +++ b/src/plugins/Makefile.am @@ -82,7 +82,7 @@ abrt_dump_oops_CPPFLAGS = \ -DPLUGINS_CONF_DIR=\"$(PLUGINS_CONF_DIR)\" \ $(GLIB_CFLAGS) \ -D_GNU_SOURCE \ - -Wall -Werror + -Wall -Wwrite-strings -Werror abrt_dump_oops_LDADD = \ ../lib/libreport.la @@ -101,7 +101,7 @@ abrt_action_analyze_c_CPPFLAGS = \ -DPLUGINS_CONF_DIR=\"$(PLUGINS_CONF_DIR)\" \ $(GLIB_CFLAGS) \ -D_GNU_SOURCE \ - -Wall -Werror + -Wall -Wwrite-strings -Werror abrt_action_analyze_c_LDADD = \ ../lib/libreport.la @@ -120,7 +120,7 @@ abrt_action_analyze_python_CPPFLAGS = \ -DPLUGINS_CONF_DIR=\"$(PLUGINS_CONF_DIR)\" \ $(GLIB_CFLAGS) \ -D_GNU_SOURCE \ - -Wall -Werror + -Wall -Wwrite-strings -Werror abrt_action_analyze_python_LDADD = \ ../lib/libreport.la @@ -139,7 +139,7 @@ abrt_action_analyze_oops_CPPFLAGS = \ -DPLUGINS_CONF_DIR=\"$(PLUGINS_CONF_DIR)\" \ $(GLIB_CFLAGS) \ -D_GNU_SOURCE \ - -Wall -Werror + -Wall -Wwrite-strings -Werror abrt_action_analyze_oops_LDADD = \ ../lib/libreport.la @@ -158,7 +158,7 @@ abrt_action_generate_backtrace_CPPFLAGS = \ -DPLUGINS_CONF_DIR=\"$(PLUGINS_CONF_DIR)\" \ $(GLIB_CFLAGS) \ -D_GNU_SOURCE \ - -Wall -Werror + -Wall -Wwrite-strings -Werror abrt_action_generate_backtrace_LDADD = \ ../lib/libreport.la \ ../btparser/libbtparser.la @@ -178,7 +178,7 @@ abrt_action_bugzilla_CPPFLAGS = \ -DPLUGINS_CONF_DIR=\"$(PLUGINS_CONF_DIR)\" \ $(GLIB_CFLAGS) \ -D_GNU_SOURCE \ - -Wall -Werror + -Wall -Wwrite-strings -Werror abrt_action_bugzilla_LDADD = \ $(GLIB_LIBS) \ ../lib/libabrt_web.la \ @@ -201,7 +201,7 @@ abrt_action_rhtsupport_CPPFLAGS = \ $(GLIB_CFLAGS) \ $(XMLRPC_CFLAGS) $(XMLRPC_CLIENT_CFLAGS) \ -D_GNU_SOURCE \ - -Wall -Werror + -Wall -Wwrite-strings -Werror abrt_action_rhtsupport_LDFLAGS = -ltar abrt_action_rhtsupport_LDADD = \ $(GLIB_LIBS) \ @@ -225,7 +225,7 @@ abrt_action_upload_CPPFLAGS = \ $(GLIB_CFLAGS) \ $(CURL_CFLAGS) \ -D_GNU_SOURCE \ - -Wall -Werror + -Wall -Wwrite-strings -Werror abrt_action_upload_LDFLAGS = -ltar abrt_action_upload_LDADD = \ $(GLIB_LIBS) \ @@ -247,7 +247,7 @@ abrt_action_kerneloops_CPPFLAGS = \ -DPLUGINS_CONF_DIR=\"$(PLUGINS_CONF_DIR)\" \ $(GLIB_CFLAGS) \ -D_GNU_SOURCE \ - -Wall -Werror + -Wall -Wwrite-strings -Werror abrt_action_kerneloops_LDADD = \ ../lib/libabrt_web.la \ ../lib/libreport.la @@ -267,7 +267,7 @@ abrt_action_mailx_CPPFLAGS = \ -DPLUGINS_CONF_DIR=\"$(PLUGINS_CONF_DIR)\" \ $(GLIB_CFLAGS) \ -D_GNU_SOURCE \ - -Wall -Werror + -Wall -Wwrite-strings -Werror abrt_action_mailx_LDADD = \ ../lib/libreport.la @@ -286,7 +286,7 @@ abrt_action_print_CPPFLAGS = \ -DPLUGINS_CONF_DIR=\"$(PLUGINS_CONF_DIR)\" \ $(GLIB_CFLAGS) \ -D_GNU_SOURCE \ - -Wall -Werror + -Wall -Wwrite-strings -Werror abrt_action_print_LDADD = \ ../lib/libreport.la @@ -296,7 +296,7 @@ abrt_action_install_debuginfo_CPPFLAGS = \ -I$(srcdir)/../include/report -I$(srcdir)/../include \ -I$(srcdir)/../lib \ -D_GNU_SOURCE \ - -Wall + -Wall -Wwrite-strings abrt_action_install_debuginfo_LDADD = abrt_retrace_client_SOURCES = \ @@ -308,7 +308,7 @@ abrt_retrace_client_SOURCES = \ $(NSS_CFLAGS) \ $(GLIB_CFLAGS) \ -D_GNU_SOURCE \ - -Wall -Werror + -Wall -Wwrite-strings -Werror abrt_retrace_client_LDADD = \ ../lib/libreport.la \ ../btparser/libbtparser.la \ diff --git a/src/report-python/Makefile.am b/src/report-python/Makefile.am index a00e2d7b..94dc3abb 100644 --- a/src/report-python/Makefile.am +++ b/src/report-python/Makefile.am @@ -23,7 +23,7 @@ _pyreport_la_CPPFLAGS = \ $(GLIB_CFLAGS) \ $(PYTHON_CFLAGS) \ -D_GNU_SOURCE \ - -Wall -Werror + -Wall -Wwrite-strings -Werror _pyreport_la_LDFLAGS = \ -module \ -avoid-version \ diff --git a/src/report-python/dump_dir.c b/src/report-python/dump_dir.c index c8ff3798..96a96fba 100644 --- a/src/report-python/dump_dir.c +++ b/src/report-python/dump_dir.c @@ -193,7 +193,7 @@ static PyMethodDef p_dump_dir_methods[] = { static PyGetSetDef p_dump_dir_getset[] = { /* attr_name, getter_func, setter_func, doc_string, void_param */ - { "name", get_name, NULL /*set_name*/ }, + { (char*) "name", get_name, NULL /*set_name*/ }, { NULL } }; diff --git a/src/report-python/reportmodule.c b/src/report-python/reportmodule.c index 41f0ba29..a684984e 100644 --- a/src/report-python/reportmodule.c +++ b/src/report-python/reportmodule.c @@ -61,7 +61,7 @@ init_pyreport(void) } /* init the exception object */ - ReportError = PyErr_NewException("_pyreport.error", NULL, NULL); + ReportError = PyErr_NewException((char*) "_pyreport.error", NULL, NULL); Py_INCREF(ReportError); PyModule_AddObject(m, "error", ReportError); diff --git a/src/report-python/run_event.c b/src/report-python/run_event.c index 6131df8e..684c7fc7 100644 --- a/src/report-python/run_event.c +++ b/src/report-python/run_event.c @@ -76,7 +76,7 @@ static void p_run_event_state_dealloc(PyObject *pself) static int post_run_callback(const char *dump_dir_name, void *param) { PyObject *obj = (PyObject*)param; - PyObject *ret = PyObject_CallMethod(obj, "post_run_callback", "(s)", dump_dir_name); + PyObject *ret = PyObject_CallMethod(obj, (char*) "post_run_callback", (char*) "(s)", dump_dir_name); int r = 0; if (ret) { @@ -89,7 +89,7 @@ static int post_run_callback(const char *dump_dir_name, void *param) static char *logging_callback(char *log_line, void *param) { PyObject *obj = (PyObject*)param; - PyObject *ret = PyObject_CallMethod(obj, "logging_callback", "(s)", log_line); + PyObject *ret = PyObject_CallMethod(obj, (char*) "logging_callback", (char*) "(s)", log_line); Py_XDECREF(ret); // TODO: handle exceptions: if (PyErr_Occurred()) ... return log_line; /* signaling to caller that we didnt consume the string */ @@ -200,8 +200,8 @@ static PyMethodDef p_run_event_state_methods[] = { static PyGetSetDef p_run_event_state_getset[] = { /* attr_name, getter_func, setter_func, doc_string, void_param */ - { "post_run_callback", get_post_run_callback, set_post_run_callback }, - { "logging_callback" , get_logging_callback , set_logging_callback }, + { (char*) "post_run_callback", get_post_run_callback, set_post_run_callback }, + { (char*) "logging_callback" , get_logging_callback , set_logging_callback }, { NULL } }; -- cgit