[PATCH] Fixes sentinel warnings on GCC4

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH] Fixes sentinel warnings on GCC4

Sjoerd Langkemper-2
This patch fixes warnings like these:
warning: missing sentinel in function call

Look at this page to find at what this warning is about:
http://www.linuxonly.nl/docs/sentinel/

This patch basically replaces NULL with (char *)NULL in functions which
are NULL-terminated. Maybe it is a good idea to define a constant for
(char *)NULL, but I don't know where that would be defined.

Sjoerd

Files that this patch modifies:
         src/core-utils/gnc-gconf-utils.c
         src/backend/file/gnc-backend-file.c
         src/backend/file/sixtp-utils.c
         src/backend/postgres/kvp-sql.c
         src/import-export/qif/qif-objects.c
         src/import-export/hbci/gnc-hbci-utils.c
         src/test-core/test-stuff.c
         src/report/report-gnome/gnc-plugin-page-report.c
         src/gnome-utils/dialog-preferences.c
         src/gnome-utils/gnc-recurrence.c
         src/gnome-utils/gnc-tree-view-commodity.c
         src/gnome-utils/gnc-plugin.c
         src/gnome-utils/gnc-plugin-file-history.c
         src/gnome-utils/gnc-tree-model-selection.c
         src/gnome-utils/gnc-tree-view-price.c
         src/gnome-utils/gnc-html.c
         src/gnome-utils/gnc-plugin-menu-additions.c
         src/gnome-utils/gnc-html-graph-gog.c
         src/gnome-utils/gnc-tree-view-account.c
         src/gnome-utils/dialog-account.c
         src/gnome-utils/gnc-tree-view.c
         src/gnome-utils/dialog-transfer.c
         src/gnome-utils/dialog-options.c
         src/gnome/window-reconcile.c
         src/gnome/lot-viewer.c
         src/gnome/gnc-plugin-page-register.c
         src/gnome/gnc-plugin-page-account-tree.c
         src/gnome/druid-merge.c
         src/gnome/dialog-print-check.c
         src/gnome/gnc-plugin-page-budget.c
         src/engine/gnc-filepath-utils.c
         src/engine/TransLog.c
         src/engine/Scrub.c
         src/engine/cap-gains.c
         src/app-utils/gnc-ui-util.c
         lib/goffice/gui-utils/go-combo-text.c
         lib/goffice/gui-utils/go-action-combo-color.c
         lib/goffice/gui-utils/go-action-combo-text.c
         lib/goffice/gui-utils/go-action-combo-stack.c
         lib/goffice/gui-utils/go-gui-utils.c
         lib/goffice/split/gui-util.c
         lib/goffice/split/gutils.c
         lib/goffice/split/plugin-loader-module.c
         lib/goffice/split/plugin-service.c
         lib/goffice/split/formats.c
         lib/goffice/split/plugin.c
         lib/goffice/split/gnumeric-gconf.c
         lib/goffice/drawing/god-drawing-renderer-gdk.c
         lib/goffice/utils/go-file.c
         lib/goffice/graph/gog-plot-engine.c
         lib/goffice/graph/gog-guru.c
         lib/goffice/graph/plugins/plot_barcol/gog-1.5d.c
         lib/goffice/graph/plugins/plot_barcol/gog-barcol-prefs.c
         lib/goffice/graph/plugins/plot_surface/gog-contour-prefs.c
         lib/goffice/graph/plugins/plot_pie/gog-pie-prefs.c
         lib/goffice/graph/plugins/plot_xy/gog-bubble-prefs.c
         lib/goffice/graph/gog-series.c
         lib/goffice/graph/gog-chart.c
         lib/goffice/graph/gog-graph.c
         lib/goffice/graph/gog-error-bar.c
         lib/goffice/graph/gog-style.c
         lib/goffice/graph/gog-object-xml.c
         lib/goffice/graph/gog-axis.c
         lib/goffice/graph/gog-object.c
         lib/glib26/gkeyfile.c
         lib/glib26/gutils26.c


Index: src/core-utils/gnc-gconf-utils.c
===================================================================
--- src/core-utils/gnc-gconf-utils.c (revision 12090)
+++ src/core-utils/gnc-gconf-utils.c (working copy)
@@ -268,7 +268,7 @@
    * order to keep this file completely "gnome-free" this approach was
    * used.
    */
-  return g_strjoin("/", APP_GNUCASH, name, NULL);
+  return g_strjoin("/", APP_GNUCASH, name, (char *)NULL);
 }
 
 char *
@@ -285,7 +285,7 @@
    * order to keep this file completely "gnome-free" this approach was
    * used.
    */
-  return g_strconcat("/schemas", APP_GNUCASH, "/", name, NULL);
+  return g_strconcat("/schemas", APP_GNUCASH, "/", name, (char *)NULL);
 }
 
 static gchar *
@@ -309,12 +309,12 @@
 
   if (*section == '/') {
     if (*name == '/')
-      return g_strjoin(NULL, section, name, NULL);
-    return g_strjoin("/", section, name, NULL);
+      return g_strjoin((char *)NULL, section, name, (char *)NULL);
+    return g_strjoin("/", section, name, (char *)NULL);
   }
 
   section_path = gnc_gconf_section_name(section);
-  key = g_strjoin("/", section_path, name, NULL);
+  key = g_strjoin("/", section_path, name, (char *)NULL);
   g_free(section_path);
   return key;
 }
@@ -328,7 +328,7 @@
   g_assert ((section != NULL) || (name != NULL));
 
   intermediate = gnc_gconf_make_key(section, name);
-  key = g_strconcat("/schemas", intermediate, NULL);
+  key = g_strconcat("/schemas", intermediate, (char *)NULL);
   g_free(intermediate);
   return key;
 }
Index: src/backend/file/gnc-backend-file.c
===================================================================
--- src/backend/file/gnc-backend-file.c (revision 12090)
+++ src/backend/file/gnc-backend-file.c (working copy)
@@ -261,7 +261,7 @@
     /* We should now have a fully resolved path name.
      * Lets see if we can get a lock on it. */
 
-    be->lockfile = g_strconcat(be->fullpath, ".LCK", NULL);
+    be->lockfile = g_strconcat(be->fullpath, ".LCK", (char *)NULL);
 
     if (!ignore_lock && !gnc_file_be_get_file_lock (be))
     {
@@ -688,7 +688,7 @@
         if (gnc_file_be_select_files (dent) == 0)
              continue;
 
-        name = g_strconcat(be->dirname, "/", dent->d_name, NULL);
+        name = g_strconcat(be->dirname, "/", dent->d_name, (char *)NULL);
         len = strlen(name) - 4;
 
         /* Is this file associated with the current data file */
Index: src/backend/file/sixtp-utils.c
===================================================================
--- src/backend/file/sixtp-utils.c (revision 12090)
+++ src/backend/file/sixtp-utils.c (working copy)
@@ -130,7 +130,7 @@
     else
     {
       char *temp;
-      temp = g_strconcat(name, (gchar *) cr->data, NULL);
+      temp = g_strconcat(name, (gchar *) cr->data, (char *)NULL);
       g_free (name);
       name = temp;
     }
Index: src/backend/postgres/kvp-sql.c
===================================================================
--- src/backend/postgres/kvp-sql.c (revision 12090)
+++ src/backend/postgres/kvp-sql.c (working copy)
@@ -211,7 +211,7 @@
    char *path_save;
 
    path_save = cb_data->path;
-   cb_data->path = g_strjoin ("/", path_save, key, NULL);
+   cb_data->path = g_strjoin ("/", path_save, key, (char *)NULL);
 
    ipath = pgendGetPathCache (be, cb_data->path, cb_data->escape);
    cb_data->ipath = ipath;
Index: src/import-export/qif/qif-objects.c
===================================================================
--- src/import-export/qif/qif-objects.c (revision 12090)
+++ src/import-export/qif/qif-objects.c (working copy)
@@ -726,7 +726,7 @@
       /* multiple 'A' lines are appended together with newlines */
       if (txn->address) {
  char *tmp = txn->address;
- txn->address = g_strconcat(tmp, "\n", line->line, NULL);
+ txn->address = g_strconcat(tmp, "\n", line->line, (char *)NULL);
  g_free(tmp);
       } else
  qif_save_str(txn->address);
Index: src/import-export/hbci/gnc-hbci-utils.c
===================================================================
--- src/import-export/hbci/gnc-hbci-utils.c (revision 12090)
+++ src/import-export/hbci/gnc-hbci-utils.c (working copy)
@@ -515,7 +515,7 @@
   if (strlen (tmp1) > 0) {
     if (*res != NULL) {
       /* The " " is the separating string in between each two strings. */
-      tmp2 = g_strjoin (" ", *res, tmp1, NULL);
+      tmp2 = g_strjoin (" ", *res, tmp1, (char *)NULL);
       g_free (tmp1);
       
       g_free (*res);
Index: src/test-core/test-stuff.c
===================================================================
--- src/test-core/test-stuff.c (revision 12090)
+++ src/test-core/test-stuff.c (working copy)
@@ -228,7 +228,7 @@
   g_free (random_chars);
 
   if (use_funky_chars)
-    random_chars = g_strconcat (plain_chars, funky_chars, NULL);
+    random_chars = g_strconcat (plain_chars, funky_chars, (char *)NULL);
   else
     random_chars = g_strdup (plain_chars);
 
Index: src/report/report-gnome/gnc-plugin-page-report.c
===================================================================
--- src/report/report-gnome/gnc-plugin-page-report.c (revision 12090)
+++ src/report/report-gnome/gnc-plugin-page-report.c (working copy)
@@ -388,7 +388,7 @@
         scm_gc_protect_object(priv->initial_report);
         scm_gc_protect_object(priv->edited_reports);
 
-        g_object_get( ppage, "report-id", &report_id, NULL );
+        g_object_get( ppage, "report-id", &report_id, (char *)NULL );
 
         PINFO("report-id: %d\n", report_id);
         
@@ -909,7 +909,7 @@
      "page-uri",       "default:",
      "ui-description", "gnc-plugin-page-report-ui.xml",
      "use-new-window", use_new,
-     NULL);
+     (char *)NULL);
  g_free(name);
 
         /* change me when the system supports multiple books */
Index: src/gnome-utils/dialog-preferences.c
===================================================================
--- src/gnome-utils/dialog-preferences.c (revision 12090)
+++ src/gnome-utils/dialog-preferences.c (working copy)
@@ -487,7 +487,7 @@
        add_in->widgetname, add_in->filename);
     return;
   }
-  g_object_get(G_OBJECT(new_content), "n-columns", &cols, NULL);
+  g_object_get(G_OBJECT(new_content), "n-columns", &cols, (char *)NULL);
   if (cols != 4) {
     g_critical("The table %s in file %s does not have four columns.  It cannot "
        "be added to the preferences dialog.",
@@ -514,7 +514,7 @@
     DEBUG("created new page %s at index %d", add_in->tabname, location.index);
   } else {
     existing_content = gtk_notebook_get_nth_page(notebook, location.index);
-    g_object_get(G_OBJECT(existing_content), "n-rows", &rows, NULL);
+    g_object_get(G_OBJECT(existing_content), "n-rows", &rows, (char *)NULL);
     DEBUG("found existing page %s at index %d", add_in->tabname, location.index);
   }
 
@@ -1381,7 +1381,7 @@
   }
 
   parts = g_strsplit(entry->key, "/", 4);
-  name = g_strconcat("gconf/", parts[3], NULL);
+  name = g_strconcat("gconf/", parts[3], (char *)NULL);
   g_strfreev(parts);
   DEBUG("proposed widget name %s", name);
 
@@ -1392,7 +1392,7 @@
   if ((widget == NULL) && (entry->value->type == GCONF_VALUE_STRING)) {
     string_value = gconf_value_get_string(entry->value);
     group_name = name;
-    name = g_strjoin("/", group_name, string_value, NULL);
+    name = g_strjoin("/", group_name, string_value, (char *)NULL);
     DEBUG("proposed widget name %s", name);
     widget = g_hash_table_lookup(table, name);
     if (widget == NULL) {
Index: src/gnome-utils/gnc-recurrence.c
===================================================================
--- src/gnome-utils/gnc-recurrence.c (revision 12090)
+++ src/gnome-utils/gnc-recurrence.c (working copy)
@@ -134,9 +134,9 @@
     g_date_set_time(&start, t);
 
     if (pt == GNCR_MONTH)
-        g_object_set(G_OBJECT(gr->nth_weekday), "visible", TRUE, NULL);
+        g_object_set(G_OBJECT(gr->nth_weekday), "visible", TRUE, (char *)NULL);
     else {
-        g_object_set(G_OBJECT(gr->nth_weekday), "visible", FALSE, NULL);
+        g_object_set(G_OBJECT(gr->nth_weekday), "visible", FALSE, (char *)NULL);
         gtk_toggle_button_set_active(
             GTK_TOGGLE_BUTTON(gr->nth_weekday), FALSE);
     }
@@ -155,7 +155,7 @@
         show_last = FALSE;
         gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(gr->gcb_eom), FALSE);
     }
-    g_object_set(G_OBJECT(gr->gcb_eom), "visible", show_last, NULL);
+    g_object_set(G_OBJECT(gr->gcb_eom), "visible", show_last, (char *)NULL);
 
     g_signal_emit_by_name(d, "changed", NULL);  // not sure if NULL is needed
 }
@@ -393,7 +393,7 @@
     grc->num_rec++;
 
     g_object_set(G_OBJECT(grc->buttRemove), "sensitive",
-                 (grc->num_rec > 1), NULL);
+                 (grc->num_rec > 1), (char *)NULL);
     g_signal_emit_by_name(G_OBJECT(grc), "changed", NULL);
 
 
@@ -412,7 +412,7 @@
 
 
     g_object_set(G_OBJECT(grc->buttRemove), "sensitive",
-                 (grc->num_rec > 1), NULL);
+                 (grc->num_rec > 1), (char *)NULL);
 
 }
 
Index: src/gnome-utils/gnc-tree-view-commodity.c
===================================================================
--- src/gnome-utils/gnc-tree-view-commodity.c (revision 12090)
+++ src/gnome-utils/gnc-tree-view-commodity.c (working copy)
@@ -456,7 +456,7 @@
   view = (GncTreeView *)g_object_new_valist (GNC_TYPE_TREE_VIEW_COMMODITY,
      first_property_name, var_args);
   va_end (var_args);
-  g_object_set(view, "name", "commodity_tree", NULL);
+  g_object_set(view, "name", "commodity_tree", (char *)NULL);
 
   /* Create/get a pointer to the existing model for this set of books. */
   ct = gnc_book_get_commodity_table (book);
Index: src/gnome-utils/gnc-plugin.c
===================================================================
--- src/gnome-utils/gnc-plugin.c (revision 12090)
+++ src/gnome-utils/gnc-plugin.c (working copy)
@@ -309,7 +309,7 @@
 
   for (i = 0; name[i]; i++) {
     action = gtk_action_group_get_action (action_group, name[i]);
-    g_object_set (G_OBJECT(action), "is_important", TRUE, NULL);
+    g_object_set (G_OBJECT(action), "is_important", TRUE, (char *)NULL);
   }
 
   /* If this trips, you've got too many "important" actions.  That
Index: src/gnome-utils/gnc-plugin-file-history.c
===================================================================
--- src/gnome-utils/gnc-plugin-file-history.c (revision 12090)
+++ src/gnome-utils/gnc-plugin-file-history.c (working copy)
@@ -307,7 +307,7 @@
  if (filename && (strlen(filename) > 0) && (index < limit)) {
   /* set the menu label (w/accelerator) */
   label_name = gnc_history_generate_label(index, filename);
-  g_object_set(G_OBJECT(action), "label", label_name, "visible", TRUE, NULL);
+  g_object_set(G_OBJECT(action), "label", label_name, "visible", TRUE, (char *)NULL);
   g_free(label_name);
 
   /* set the filename for the callback function */
@@ -316,7 +316,7 @@
     g_free(old_filename);
   g_object_set_data(G_OBJECT(action), FILENAME_STRING, g_strdup(filename));
  } else {
-  g_object_set(G_OBJECT(action), "visible", FALSE, NULL);
+  g_object_set(G_OBJECT(action), "visible", FALSE, (char *)NULL);
  }
  g_free(action_name);
  LEAVE("");
Index: src/gnome-utils/gnc-tree-model-selection.c
===================================================================
--- src/gnome-utils/gnc-tree-model-selection.c (revision 12090)
+++ src/gnome-utils/gnc-tree-model-selection.c (working copy)
@@ -266,7 +266,7 @@
  GtkTreeViewColumn *column;
 
  renderer = gtk_cell_renderer_toggle_new ();
- g_object_set (G_OBJECT (renderer), "activatable", TRUE, NULL);
+ g_object_set (G_OBJECT (renderer), "activatable", TRUE, (char *)NULL);
  g_signal_connect (G_OBJECT (renderer), "toggled",
   G_CALLBACK (gnc_tree_model_selection_toggled), model);
 
Index: src/gnome-utils/gnc-tree-view-price.c
===================================================================
--- src/gnome-utils/gnc-tree-view-price.c (revision 12090)
+++ src/gnome-utils/gnc-tree-view-price.c (working copy)
@@ -397,7 +397,7 @@
   view = (GncTreeView *)g_object_new_valist (GNC_TYPE_TREE_VIEW_PRICE,
      first_property_name, var_args);
   va_end (var_args);
-  g_object_set(view, "name", "price_tree", NULL);
+  g_object_set(view, "name", "price_tree", (char *)NULL);
 
   /* Create/get a pointer to the existing model for this set of books. */
   price_db = gnc_pricedb_get_db(book);
Index: src/gnome-utils/gnc-html.c
===================================================================
--- src/gnome-utils/gnc-html.c (revision 12090)
+++ src/gnome-utils/gnc-html.c (working copy)
@@ -235,7 +235,7 @@
         *url_location = g_strdup(path);
       }
       else {
-        *url_location = g_strconcat(html->base_location, "/", path, NULL);
+        *url_location = g_strconcat(html->base_location, "/", path, (char *)NULL);
       }
       g_free(path);
     }
@@ -255,10 +255,10 @@
       if(path[0] == '/') {
         *url_location =
           g_strconcat(extract_machine_name(html->base_location),
-                      "/", path+1, NULL);
+                      "/", path+1, (char *)NULL);
       }
       else {
-        *url_location = g_strconcat(html->base_location, path, NULL);
+        *url_location = g_strconcat(html->base_location, path, (char *)NULL);
       }
       g_free(path);
     }
@@ -329,10 +329,10 @@
   
   if(machine) {
     if(base && (strlen(base) > 0)) {
-      basename = g_strconcat(machine, "/", base, "/", NULL);
+      basename = g_strconcat(machine, "/", base, "/", (char *)NULL);
     }
     else {
-      basename = g_strconcat(machine, "/", NULL);
+      basename = g_strconcat(machine, "/", (char *)NULL);
     }
   }
   else {
@@ -855,10 +855,10 @@
 
   DEBUG(" ");
   if(old_str) {
-    new_str = g_strconcat(old_str, "&", enc_key, "=", enc_val, NULL);
+    new_str = g_strconcat(old_str, "&", enc_key, "=", enc_val, (char *)NULL);
   }
   else {
-    new_str = g_strconcat(enc_key, "=", enc_val, NULL);
+    new_str = g_strconcat(enc_key, "=", enc_val, (char *)NULL);
   }
   *(char **)user_data = new_str;
   g_free(old_str);
@@ -1606,7 +1606,7 @@
   char    * encoded = gnc_html_pack_form_data(form_data);
 
   type    = gnc_html_parse_url(html, action, &location, &label);
-  fullurl = g_strconcat(location, "?", encoded, NULL);
+  fullurl = g_strconcat(location, "?", encoded, (char *)NULL);
   gnc_html_show_url(html, type, fullurl, label, 0);
 
   g_free(encoded);
@@ -1651,7 +1651,7 @@
                 "Content-Disposition: form-data; name=\"",
                 (char *)key, "\"\r\n\r\n",
                 (char *)val, "\r\n",
-                NULL);
+                (char *)NULL);
   *(char **)user_data = new_str;
   g_free(old_str);
 }
@@ -1669,7 +1669,7 @@
   g_hash_table_foreach(form_data, multipart_post_helper, &htmlstr);
   
   /* add the closing boundary marker */
-  next_htmlstr = g_strconcat(htmlstr, "--XXXgncXXX--\r\n", NULL);
+  next_htmlstr = g_strconcat(htmlstr, "--XXXgncXXX--\r\n", (char *)NULL);
   g_free(htmlstr);
   htmlstr = next_htmlstr;
   next_htmlstr = NULL;
Index: src/gnome-utils/gnc-plugin-menu-additions.c
===================================================================
--- src/gnome-utils/gnc-plugin-menu-additions.c (revision 12090)
+++ src/gnome-utils/gnc-plugin-menu-additions.c (working copy)
@@ -298,7 +298,7 @@
   map = g_hash_table_lookup(table, info->path);
   if (map == NULL)
     map = "";
-  new_map = g_strconcat(map, accel_key, (gchar *)NULL);
+  new_map = g_strconcat(map, accel_key, (gchar *)(char *)NULL);
   DEBUG("path '%s', map '%s' -> '%s'", info->path, map, new_map);
   g_hash_table_replace(table, info->path, new_map);
 
@@ -361,14 +361,14 @@
   /* Now build a new string in the form "<start>_<end>". */
   start = g_strndup(info->ae.label, ptr - info->ae.label);
   DEBUG("start %p, len %ld, text '%s'", start, g_utf8_strlen(start, -1), start);
-  new_label = g_strconcat(start, "_", ptr, (gchar *)NULL);
+  new_label = g_strconcat(start, "_", ptr, (gchar *)(char *)NULL);
   g_free(start);
   DEBUG("label '%s' -> '%s'", info->ae.label, new_label);
   g_free((gchar *)info->ae.label);
   info->ae.label = new_label;
 
   /* Now build a new map. Old one freed automatically. */
-  new_map = g_strconcat(map, buf, (gchar *)NULL);
+  new_map = g_strconcat(map, buf, (gchar *)(char *)NULL);
   DEBUG("map '%s' -> '%s'", map, new_map);
   g_hash_table_replace(table, info->path, new_map);
 
Index: src/gnome-utils/gnc-html-graph-gog.c
===================================================================
--- src/gnome-utils/gnc-html-graph-gog.c (revision 12090)
+++ src/gnome-utils/gnc-html-graph-gog.c (working copy)
@@ -448,7 +448,7 @@
                 //"vary_style_by_element", TRUE,
                 "type",                         barType,
                 "overlap_percentage",           barOverlap,
- NULL);
+ (char *)NULL);
 #ifdef HAVE_GOFFICE
   labelData = go_data_vector_str_new(  (char const * const *)col_labels, datacols, NULL );
 #else
Index: src/gnome-utils/gnc-tree-view-account.c
===================================================================
--- src/gnome-utils/gnc-tree-view-account.c (revision 12090)
+++ src/gnome-utils/gnc-tree-view-account.c (working copy)
@@ -1229,7 +1229,7 @@
     g_object_set (G_OBJECT (cell),
                   "text", kvp_frame_get_string(frame, (gchar *)key),
                   "xalign", 0.0,
-                  NULL);
+                  (char *)NULL);
     
 }
 
@@ -1255,7 +1255,7 @@
     list = gtk_tree_view_column_get_cell_renderers(column);
     renderer = list->data;
     g_list_free(list);
-    g_object_set (G_OBJECT (renderer), "xalign", 1.0, NULL);
+    g_object_set (G_OBJECT (renderer), "xalign", 1.0, (char *)NULL);
 
     gtk_tree_view_column_set_cell_data_func (column, renderer,
      account_cell_kvp_data_func,
@@ -1296,7 +1296,7 @@
     col_source_cb = (GncTreeViewAccountColumnSource) _col_source_cb;
     account = gnc_tree_view_account_get_account_from_iter(s_model, s_iter);
     text = col_source_cb(account, col, cell);
-    g_object_set (G_OBJECT (cell), "text", text, "xalign", 1.0, NULL);
+    g_object_set (G_OBJECT (cell), "text", text, "xalign", 1.0, (char *)NULL);
     g_free(text);
 }
 
@@ -1316,12 +1316,12 @@
     g_return_val_if_fail (GNC_IS_TREE_VIEW_ACCOUNT (account_view), NULL);
     
     renderer = gtk_cell_renderer_text_new ();
-    g_object_set (G_OBJECT (renderer), "xalign", 1.0, NULL);
+    g_object_set (G_OBJECT (renderer), "xalign", 1.0, (char *)NULL);
     
     column = gtk_tree_view_column_new_with_attributes (column_title,
                                                        renderer, NULL);
     if (col_edited_cb) {
-        g_object_set(G_OBJECT(renderer), "editable", TRUE, NULL);
+        g_object_set(G_OBJECT(renderer), "editable", TRUE, (char *)NULL);
         g_object_set_data(G_OBJECT(renderer), "column_edited_callback",
                           col_edited_cb);
         s_model = gtk_tree_view_get_model(GTK_TREE_VIEW(account_view));
Index: src/gnome-utils/dialog-account.c
===================================================================
--- src/gnome-utils/dialog-account.c (revision 12090)
+++ src/gnome-utils/dialog-account.c (working copy)
@@ -898,7 +898,7 @@
       sep_string[1] = '\0';
 
       fullname_parent = xaccAccountGetFullName(parent_account, separator);
-      fullname = g_strconcat(fullname_parent, sep_string, name, NULL);
+      fullname = g_strconcat(fullname_parent, sep_string, name, (char *)NULL);
 
       account = xaccGetAccountFromFullName(group, fullname, separator);
 
@@ -1415,7 +1415,7 @@
     sep_string[0] = gnc_get_account_separator ();
     sep_string[1] = '\0';
 
-    fullname = g_strconcat (parent_name, sep_string, name, NULL);
+    fullname = g_strconcat (parent_name, sep_string, name, (char *)NULL);
 
     g_free (parent_name);
   }
@@ -1437,7 +1437,7 @@
   fullname = get_ui_fullname (aw);
 
   if (aw->dialog_type == EDIT_ACCOUNT)
-    title = g_strconcat(_("Edit Account"), " - ", fullname, NULL);
+    title = g_strconcat(_("Edit Account"), " - ", fullname, (char *)NULL);
   else if (g_list_length (aw->subaccount_names) > 0)
   {
     const char *format = _("(%d) New Accounts");
@@ -1446,12 +1446,12 @@
     prefix = g_strdup_printf (format,
                               g_list_length (aw->subaccount_names) + 1);
 
-    title = g_strconcat (prefix, " - ", fullname, " ...", NULL);
+    title = g_strconcat (prefix, " - ", fullname, " ...", (char *)NULL);
 
     g_free (prefix);
   }
   else
-    title = g_strconcat (_("New Account"), " - ", fullname, NULL);
+    title = g_strconcat (_("New Account"), " - ", fullname, (char *)NULL);
 
   gtk_window_set_title (GTK_WINDOW(aw->dialog), title);
 
Index: src/gnome-utils/gnc-tree-view.c
===================================================================
--- src/gnome-utils/gnc-tree-view.c (revision 12090)
+++ src/gnome-utils/gnc-tree-view.c (working copy)
@@ -256,7 +256,7 @@
   priv->size_allocate_cb_id = 0;
 
   /* Ask gtk to help the user keep track of rows. */
-  g_object_set(view, "rules-hint", TRUE, NULL);
+  g_object_set(view, "rules-hint", TRUE, (char *)NULL);
 
   /* Handle column drag and drop */
   gtk_tree_view_set_column_drag_function(GTK_TREE_VIEW(view),
@@ -1422,7 +1422,7 @@
     /* Show the menu popup button */
     if (priv->column_menu_column)
       g_object_set(G_OBJECT(priv->column_menu_column),
-   "visible", TRUE, NULL);
+   "visible", TRUE, (char *)NULL);
 
     /* Now build a new menu */
     column_list = gtk_tree_view_get_columns(GTK_TREE_VIEW(view));
@@ -1432,7 +1432,7 @@
     /* Hide the menu popup button */
     if (priv->column_menu_column)
       g_object_set(G_OBJECT(priv->column_menu_column),
-   "visible", FALSE, NULL);
+   "visible", FALSE, (char *)NULL);
   }
   LEAVE("menu: show %d, section %s", priv->show_column_menu,
  priv->gconf_section);
@@ -1730,7 +1730,7 @@
        "fixed-width", width,
        "resizable",   resizable && pref_name != NULL,
        "reorderable", pref_name != NULL,
-       NULL);
+       (char *)NULL);
 
   s_model = gtk_tree_view_get_model(GTK_TREE_VIEW(view));
   if (GTK_IS_TREE_MODEL_SORT(s_model)) {
@@ -1845,7 +1845,7 @@
   /* Set up an icon renderer if requested */
   if (stock_icon_name) {
     renderer = gtk_cell_renderer_pixbuf_new ();
-    g_object_set (renderer, "stock-id", stock_icon_name, NULL);
+    g_object_set (renderer, "stock-id", stock_icon_name, (char *)NULL);
     gtk_tree_view_column_pack_start (column, renderer, FALSE);
   }
 
@@ -1913,8 +1913,8 @@
   g_list_free(renderers);
 
   /* Right align the column title and data */
-  g_object_set(G_OBJECT(column), "alignment",   1.0, NULL);
-  g_object_set(G_OBJECT(renderer), "xalign",   1.0, NULL);
+  g_object_set(G_OBJECT(column), "alignment",   1.0, (char *)NULL);
+  g_object_set(G_OBJECT(renderer), "xalign",   1.0, (char *)NULL);
 
   /* Change the text color */
   if (model_color_column != GNC_TREE_VIEW_COLUMN_COLOR_NONE)
Index: src/gnome-utils/dialog-transfer.c
===================================================================
--- src/gnome-utils/dialog-transfer.c (revision 12090)
+++ src/gnome-utils/dialog-transfer.c (working copy)
@@ -1718,11 +1718,11 @@
       label = glade_xml_get_widget (xml, "left_trans_label");
       xferData->to_transfer_label = label;
 
-      text = g_strconcat ("<b>", _("Credit Account"), "</b>", NULL);
+      text = g_strconcat ("<b>", _("Credit Account"), "</b>", (char *)NULL);
       gtk_label_set_markup (GTK_LABEL (xferData->from_transfer_label), text);
       g_free (text);
 
-      text = g_strconcat ("<b>", _("Debit Account"), "</b>", NULL);
+      text = g_strconcat ("<b>", _("Debit Account"), "</b>", (char *)NULL);
       gtk_label_set_markup (GTK_LABEL (xferData->to_transfer_label), text);
       g_free (text);
 
@@ -1739,11 +1739,11 @@
       label = glade_xml_get_widget (xml, "right_trans_label");
       xferData->to_transfer_label = label;
 
-      text = g_strconcat ("<b>", _("Transfer From"), "</b>", NULL);
+      text = g_strconcat ("<b>", _("Transfer From"), "</b>", (char *)NULL);
       gtk_label_set_markup (GTK_LABEL (xferData->from_transfer_label), text);
       g_free (text);
 
-      text = g_strconcat ("<b>", _("Transfer To"), "</b>", NULL);
+      text = g_strconcat ("<b>", _("Transfer To"), "</b>", (char *)NULL);
       gtk_label_set_markup (GTK_LABEL (xferData->to_transfer_label), text);
 
       label = glade_xml_get_widget (xml, "left_currency_label");
Index: src/gnome-utils/dialog-options.c
===================================================================
--- src/gnome-utils/dialog-options.c (revision 12090)
+++ src/gnome-utils/dialog-options.c (working copy)
@@ -1386,7 +1386,7 @@
   GtkWidget *label;
   gchar *colon_name;
 
-  colon_name = g_strconcat(name, ":", NULL);
+  colon_name = g_strconcat(name, ":", (char *)NULL);
   label = gtk_label_new(colon_name);
   gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5);
   g_free(colon_name);
@@ -1457,7 +1457,7 @@
   GtkWidget *label;
   gchar *colon_name;
 
-  colon_name = g_strconcat(name, ":", NULL);
+  colon_name = g_strconcat(name, ":", (char *)NULL);
   label = gtk_label_new(colon_name);
   gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5);
   g_free(colon_name);
@@ -1492,7 +1492,7 @@
   GtkWidget *label;
   gchar *colon_name;
 
-  colon_name = g_strconcat(name, ":", NULL);
+  colon_name = g_strconcat(name, ":", (char *)NULL);
   label = gtk_label_new(colon_name);
   gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5);
   g_free(colon_name);
@@ -1530,7 +1530,7 @@
   GtkWidget *label;
   gchar *colon_name;
 
-  colon_name = g_strconcat(name, ":", NULL);
+  colon_name = g_strconcat(name, ":", (char *)NULL);
   label= gtk_label_new(colon_name);
   gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5);
   g_free(colon_name);
@@ -1558,7 +1558,7 @@
   GtkWidget *label;
   gchar *colon_name;
 
-  colon_name = g_strconcat(name, ":", NULL);
+  colon_name = g_strconcat(name, ":", (char *)NULL);
   label= gtk_label_new(colon_name);
   gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5);
   g_free(colon_name);
@@ -1623,7 +1623,7 @@
   GList *acct_type_list;
   gchar *colon_name;
 
-  colon_name = g_strconcat(name, ":", NULL);
+  colon_name = g_strconcat(name, ":", (char *)NULL);
   label = gtk_label_new(colon_name);
   gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5);
   g_free(colon_name);
@@ -1700,7 +1700,7 @@
   gdouble step_size = 1.0;
   int num_decimals = 0;
 
-  colon_name = g_strconcat(name, ":", NULL);
+  colon_name = g_strconcat(name, ":", (char *)NULL);
   label = gtk_label_new(colon_name);
   gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5);
   g_free(colon_name);
@@ -1780,7 +1780,7 @@
   gchar *colon_name;
   gboolean use_alpha;
 
-  colon_name = g_strconcat(name, ":", NULL);
+  colon_name = g_strconcat(name, ":", (char *)NULL);
   label = gtk_label_new(colon_name);
   gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5);
   g_free(colon_name);
@@ -1816,7 +1816,7 @@
   GtkWidget *label;
   gchar *colon_name;
 
-  colon_name = g_strconcat(name, ":", NULL);
+  colon_name = g_strconcat(name, ":", (char *)NULL);
   label = gtk_label_new(colon_name);
   gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5);
   g_free(colon_name);
@@ -1857,7 +1857,7 @@
   gchar *colon_name;
 
   ENTER("option %p(%s), name %s", option, gnc_option_name(option), name);
-  colon_name = g_strconcat(name, ":", NULL);
+  colon_name = g_strconcat(name, ":", (char *)NULL);
   label = gtk_label_new(colon_name);
   gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5);
   g_free(colon_name);
Index: src/engine/gnc-filepath-utils.c
===================================================================
--- src/engine/gnc-filepath-utils.c (revision 12090)
+++ src/engine/gnc-filepath-utils.c (working copy)
@@ -68,7 +68,7 @@
   home = getenv ("HOME");
   if (!home) return;
 
-  path = g_strconcat(home, "/.gnucash", NULL);
+  path = g_strconcat(home, "/.gnucash", (char *)NULL);
 
   rc = stat (path, &statbuf);
   if (rc)
@@ -80,7 +80,7 @@
     mkdir (path, S_IRWXU);   /* perms = S_IRWXU = 0700 */
   }
 
-  data = g_strconcat (path, "/data", NULL);
+  data = g_strconcat (path, "/data", (char *)NULL);
   rc = stat (data, &statbuf);
   if (rc)
     mkdir (data, S_IRWXU);
@@ -400,11 +400,11 @@
   }
   g_assert(home);
 
-  dotgnucash = g_build_filename(home, ".gnucash", (gchar *)NULL);
+  dotgnucash = g_build_filename(home, ".gnucash", (gchar *)(char *)NULL);
   gnc_validate_directory(dotgnucash);
 
   /* Since we're in code that is only executed once.... */
-  books_dir = g_build_filename(dotgnucash, "books", (gchar *)NULL);
+  books_dir = g_build_filename(dotgnucash, "books", (gchar *)(char *)NULL);
   gnc_validate_directory(books_dir);
   g_free(books_dir);
 
@@ -414,13 +414,13 @@
 gchar *
 gnc_build_dotgnucash_path (const gchar *filename)
 {
-  return g_build_filename(gnc_dotgnucash_dir(), filename, (gchar *)NULL);
+  return g_build_filename(gnc_dotgnucash_dir(), filename, (gchar *)(char *)NULL);
 }
 
 gchar *
 gnc_build_book_path (const gchar *filename)
 {
-  return g_build_filename(gnc_dotgnucash_dir(), "books", filename, (gchar *)NULL);
+  return g_build_filename(gnc_dotgnucash_dir(), "books", filename, (gchar *)(char *)NULL);
 }
 
 /* =============================== END OF FILE ========================== */
Index: src/engine/TransLog.c
===================================================================
--- src/engine/TransLog.c (revision 12090)
+++ src/engine/TransLog.c (working copy)
@@ -123,7 +123,7 @@
    /* tag each filename with a timestamp */
    timestamp = xaccDateUtilGetStampNow ();
 
-   filename = g_strconcat (log_base_name, ".", timestamp, ".log", NULL);
+   filename = g_strconcat (log_base_name, ".", timestamp, ".log", (char *)NULL);
 
    trans_log = fopen (filename, "a");
    if (!trans_log) {
Index: src/engine/Scrub.c
===================================================================
--- src/engine/Scrub.c (revision 12090)
+++ src/engine/Scrub.c (working copy)
@@ -855,7 +855,7 @@
   }
 
   accname = g_strconcat (name_root, "-",
-                         gnc_commodity_get_mnemonic (currency), NULL);
+                         gnc_commodity_get_mnemonic (currency), (char *)NULL);
 
   /* See if we've got one of these going already ... */
   acc = xaccGetAccountFromName (root, accname);
Index: src/engine/cap-gains.c
===================================================================
--- src/engine/cap-gains.c (revision 12090)
+++ src/engine/cap-gains.c (working copy)
@@ -224,7 +224,7 @@
   }
 
   accname = g_strconcat (_("Orphaned Gains"), "-",
-                         gnc_commodity_get_mnemonic (currency), NULL);
+                         gnc_commodity_get_mnemonic (currency), (char *)NULL);
 
   /* See if we've got one of these going already ... */
   acc = xaccGetAccountFromName (root, accname);
Index: src/gnome/window-reconcile.c
===================================================================
--- src/gnome/window-reconcile.c (revision 12090)
+++ src/gnome/window-reconcile.c (working copy)
@@ -383,7 +383,7 @@
   char *title;
 
   fullname = xaccAccountGetFullName(account, gnc_get_account_separator());
-  title = g_strconcat(fullname, " - ", _(text), NULL);
+  title = g_strconcat(fullname, " - ", _(text), (char *)NULL);
 
   g_free(fullname);
 
@@ -1096,7 +1096,7 @@
   char *title;
 
   fullname = xaccAccountGetFullName(account, gnc_get_account_separator());
-  title = g_strconcat(fullname, " - ", _("Reconcile"), NULL);
+  title = g_strconcat(fullname, " - ", _("Reconcile"), (char *)NULL);
 
   g_free(fullname);
 
Index: src/gnome/lot-viewer.c
===================================================================
--- src/gnome/lot-viewer.c (revision 12090)
+++ src/gnome/lot-viewer.c (working copy)
@@ -521,7 +521,7 @@
    param_name = g_param_spec_get_name(pspec);
    if (strcmp(param_name, "position") != 0)
      return;
-   g_object_get(gobject, "position", &value, NULL);
+   g_object_get(gobject, "position", &value, (char *)NULL);
 
    if (GTK_IS_HPANED(gobject)) {
      gnc_gconf_set_int(GCONF_SECTION, GCONF_KEY_HPOSITION, value, NULL);
Index: src/gnome/gnc-plugin-page-register.c
===================================================================
--- src/gnome/gnc-plugin-page-register.c (revision 12090)
+++ src/gnome/gnc-plugin-page-register.c (working copy)
@@ -493,7 +493,7 @@
      "page-uri",       "default:",
      "ui-description", "gnc-plugin-page-register-ui.xml",
      "use-new-window", use_new,
-     NULL);
+     (char *)NULL);
 
  /* Create menu and toolbar information */
  action_group =
@@ -1517,11 +1517,11 @@
 
     if (ledger_type == LD_SINGLE)
     {
-      name = g_strconcat (account_name, " - ", reg_name, NULL);
+      name = g_strconcat (account_name, " - ", reg_name, (char *)NULL);
     }
     else
     {
-      name = g_strconcat (account_name, " ", _("and subaccounts"), " - ", reg_name, NULL);
+      name = g_strconcat (account_name, " ", _("and subaccounts"), " - ", reg_name, (char *)NULL);
     }
     g_free(account_name);
   }
Index: src/gnome/gnc-plugin-page-account-tree.c
===================================================================
--- src/gnome/gnc-plugin-page-account-tree.c (revision 12090)
+++ src/gnome/gnc-plugin-page-account-tree.c (working copy)
@@ -319,7 +319,7 @@
      "page-name",      _("Accounts"),
      "page-uri",       "default:",
      "ui-description", "gnc-plugin-page-account-tree-ui.xml",
-     NULL);
+     (char *)NULL);
 
  /* change me when the system supports multiple books */
  gnc_plugin_page_add_book(parent, gnc_get_current_book());
@@ -488,7 +488,7 @@
  g_object_set(G_OBJECT(tree_view),
      "gconf-section", GCONF_SECTION,
      "show-column-menu", TRUE,
-     NULL);
+     (char *)NULL);
 
  priv->tree_view = tree_view;
  selection = gtk_tree_view_get_selection(tree_view);
Index: src/gnome/dialog-print-check.c
===================================================================
--- src/gnome/dialog-print-check.c (revision 12090)
+++ src/gnome/dialog-print-check.c (working copy)
@@ -141,7 +141,7 @@
   gtk_widget_destroy(pcd->dialog);
   pcd->dialog = NULL;
 
-  g_object_set_data(G_OBJECT(pcd->plugin_page), PRINT_CHECK_DATA, NULL);
+  g_object_set_data(G_OBJECT(pcd->plugin_page), PRINT_CHECK_DATA, (char *)NULL);
   g_free(pcd);
 }
 
Index: src/gnome/druid-merge.c
===================================================================
--- src/gnome/druid-merge.c (revision 12090)
+++ src/gnome/druid-merge.c (working copy)
@@ -363,15 +363,15 @@
  buffer = g_strdup_printf("\n%i conflicts need to be resolved.\n", remainder);
  }
  buffer = g_strconcat(buffer, g_strdup_printf("\n%i parameter values for this \"%s\" object.\n",
-   g_slist_length(user_reports), rule->targetEnt->e_type), NULL);
+   g_slist_length(user_reports), rule->targetEnt->e_type), (char *)NULL);
  while(user_reports != NULL) {
  one_param = user_reports->data;
  buffer = g_strconcat(buffer, g_strdup_printf("%i:Parameter name: %s ",
- count, one_param->param_name), NULL);
+ count, one_param->param_name), (char *)NULL);
  importstring = qof_book_merge_param_as_string(one_param, rule->importEnt);
- buffer = g_strconcat(buffer, g_strdup_printf("Import data : %s ", importstring), NULL);
+ buffer = g_strconcat(buffer, g_strdup_printf("Import data : %s ", importstring), (char *)NULL);
  targetstring = qof_book_merge_param_as_string(one_param, rule->targetEnt);
- buffer = g_strconcat(buffer, g_strdup_printf("Original data : %s\n", targetstring), NULL);
+ buffer = g_strconcat(buffer, g_strdup_printf("Original data : %s\n", targetstring), (char *)NULL);
  user_reports = g_slist_next(user_reports);
  count++;
  }
Index: src/gnome/gnc-plugin-page-budget.c
===================================================================
--- src/gnome/gnc-plugin-page-budget.c (revision 12090)
+++ src/gnome/gnc-plugin-page-budget.c (working copy)
@@ -255,7 +255,7 @@
  "page-name",      _("Budget"),
  "page-uri",       "default:",
  "ui-description", "gnc-plugin-page-budget-ui.xml",
- NULL);
+ (char *)NULL);
 
     /* change me when the system supports multiple books */
     gnc_plugin_page_add_book(parent, gnc_get_current_book());
Index: src/app-utils/gnc-ui-util.c
===================================================================
--- src/app-utils/gnc-ui-util.c (revision 12090)
+++ src/app-utils/gnc-ui-util.c (working copy)
@@ -586,7 +586,7 @@
     return account;
 
   name = g_strconcat (base_name, " - ",
-                      gnc_commodity_get_mnemonic (currency), NULL);
+                      gnc_commodity_get_mnemonic (currency), (char *)NULL);
   account = xaccGetAccountFromName (group, name);
   if (account && xaccAccountGetType (account) != EQUITY)
     account = NULL;
Index: lib/goffice/gui-utils/go-combo-text.c
===================================================================
--- lib/goffice/gui-utils/go-combo-text.c (revision 12090)
+++ lib/goffice/gui-utils/go-combo-text.c (working copy)
@@ -187,7 +187,7 @@
  ct->rows = 0;
  ct->entry = gtk_entry_new ();
  ct->list = gtk_tree_view_new ();
- //g_object_set (G_OBJECT (ct->list), NULL);
+ //g_object_set (G_OBJECT (ct->list), (char *)NULL);
  gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (ct->list), FALSE);
  store = gtk_list_store_new (1, G_TYPE_STRING);
  gtk_tree_view_set_model (GTK_TREE_VIEW (ct->list), GTK_TREE_MODEL (store));
Index: lib/goffice/gui-utils/go-action-combo-color.c
===================================================================
--- lib/goffice/gui-utils/go-action-combo-color.c (revision 12090)
+++ lib/goffice/gui-utils/go-action-combo-color.c (working copy)
@@ -118,7 +118,7 @@
 get_title (GtkAction *a)
 {
  char *res;
- g_object_get (G_OBJECT (a), "label", &res, NULL);
+ g_object_get (G_OBJECT (a), "label", &res, (char *)NULL);
  return res;
 }
 
Index: lib/goffice/gui-utils/go-action-combo-text.c
===================================================================
--- lib/goffice/gui-utils/go-action-combo-text.c (revision 12090)
+++ lib/goffice/gui-utils/go-action-combo-text.c (working copy)
@@ -146,7 +146,7 @@
  _(gtk_action_get_name (act)));
  gtk_widget_set_size_request (
  go_combo_text_get_entry (tool->combo), w, -1);
- g_object_set (G_OBJECT (tool), "visible_vertical", FALSE, NULL);
+ g_object_set (G_OBJECT (tool), "visible_vertical", FALSE, (char *)NULL);
 
  go_combo_box_set_relief (GO_COMBO_BOX (tool->combo), GTK_RELIEF_NONE);
  go_combo_box_set_tearable (GO_COMBO_BOX (tool->combo), TRUE);
Index: lib/goffice/gui-utils/go-action-combo-stack.c
===================================================================
--- lib/goffice/gui-utils/go-action-combo-stack.c (revision 12090)
+++ lib/goffice/gui-utils/go-action-combo-stack.c (working copy)
@@ -314,7 +314,7 @@
  "text", 0,
  NULL));
 
- g_object_get (G_OBJECT (a), "stock_id", &stock_id, NULL);
+ g_object_get (G_OBJECT (a), "stock_id", &stock_id, (char *)NULL);
  image = gtk_image_new_from_stock (
  stock_id, GTK_ICON_SIZE_LARGE_TOOLBAR);
  g_free (stock_id);
Index: lib/goffice/gui-utils/go-gui-utils.c
===================================================================
--- lib/goffice/gui-utils/go-gui-utils.c (revision 12090)
+++ lib/goffice/gui-utils/go-gui-utils.c (working copy)
@@ -102,7 +102,7 @@
 
  if (!g_path_is_absolute (gladefile)) {
  char *d = gnm_sys_glade_dir ();
- f = g_build_filename (d, gladefile, NULL);
+ f = g_build_filename (d, gladefile, (char *)NULL);
  g_free (d);
  } else
  f = g_strdup (gladefile);
Index: lib/goffice/drawing/god-drawing-renderer-gdk.c
===================================================================
--- lib/goffice/drawing/god-drawing-renderer-gdk.c (revision 12090)
+++ lib/goffice/drawing/god-drawing-renderer-gdk.c (working copy)
@@ -234,41 +234,41 @@
  GodParagraphAttributesFlags flags;
  g_object_get (paragraph->para_attributes,
       "flags", &flags,
-      NULL);
+      (char *)NULL);
  if (flags & GOD_PARAGRAPH_ATTRIBUTES_FLAGS_SPACE_BEFORE)
  g_object_get (paragraph->para_attributes,
       "space_before", &space_before,
-      NULL);
+      (char *)NULL);
  if (flags & GOD_PARAGRAPH_ATTRIBUTES_FLAGS_SPACE_AFTER)
  g_object_get (paragraph->para_attributes,
       "space_after", &space_after,
-      NULL);
+      (char *)NULL);
  if (flags & GOD_PARAGRAPH_ATTRIBUTES_FLAGS_INDENT)
  g_object_get (paragraph->para_attributes,
       "indent", &indent,
-      NULL);
+      (char *)NULL);
  if (flags & GOD_PARAGRAPH_ATTRIBUTES_FLAGS_ALIGNMENT)
  g_object_get (paragraph->para_attributes,
       "alignment", &alignment,
-      NULL);
+      (char *)NULL);
  if (flags & GOD_PARAGRAPH_ATTRIBUTES_FLAGS_BULLET_CHARACTER)
  g_object_get (paragraph->para_attributes,
       "bullet_character", &bullet_character,
-      NULL);
+      (char *)NULL);
  if (flags & GOD_PARAGRAPH_ATTRIBUTES_FLAGS_BULLET_INDENT)
  g_object_get (paragraph->para_attributes,
       "bullet_indent", &bullet_indent,
-      NULL);
+      (char *)NULL);
  if (flags & GOD_PARAGRAPH_ATTRIBUTES_FLAGS_BULLET_SIZE)
  g_object_get (paragraph->para_attributes,
       "bullet_size", &bullet_size,
-      NULL);
+      (char *)NULL);
  if (flags & GOD_PARAGRAPH_ATTRIBUTES_FLAGS_BULLET_FAMILY) {
  g_free (bullet_family);
  bullet_family = NULL;
  g_object_get (paragraph->para_attributes,
       "bullet_family", &bullet_family,
-      NULL);
+      (char *)NULL);
  }
  }
  draw_context->y_ofs += space_before;
Index: lib/goffice/split/gui-util.c
===================================================================
--- lib/goffice/split/gui-util.c (revision 12090)
+++ lib/goffice/split/gui-util.c (working copy)
@@ -372,8 +372,8 @@
  * One of these causes a recursive call which will do nothing due to
  * ->freed.
  */
- g_object_set_data (G_OBJECT (ctxt->wbcg), ctxt->key, NULL);
- g_object_set_data (G_OBJECT (ctxt->dialog), "KeyedDialog", NULL);
+ g_object_set_data (G_OBJECT (ctxt->wbcg), ctxt->key, (char *)NULL);
+ g_object_set_data (G_OBJECT (ctxt->dialog), "KeyedDialog", (char *)NULL);
  g_free (ctxt);
 }
 
@@ -637,7 +637,7 @@
 
  if (!g_path_is_absolute (gladefile)) {
  char *d = gnm_sys_glade_dir ();
- f = g_build_filename (d, gladefile, NULL);
+ f = g_build_filename (d, gladefile, (char *)NULL);
  g_free (d);
  } else
  f = g_strdup (gladefile);
@@ -990,8 +990,8 @@
 char *
 gnumeric_icondir (char const *filename)
 {
- //return g_build_filename (gnumeric_icon_dir, filename, NULL);
- return g_build_filename( "FIXME-icondir", filename, NULL );
+ //return g_build_filename (gnumeric_icon_dir, filename, (char *)NULL);
+ return g_build_filename( "FIXME-icondir", filename, (char *)NULL );
 }
 
 GtkWidget *
Index: lib/goffice/split/gutils.c
===================================================================
--- lib/goffice/split/gutils.c (revision 12090)
+++ lib/goffice/split/gutils.c (working copy)
@@ -268,13 +268,13 @@
 {
  if (subdir == NULL)
  return (char *)gnumeric_data_dir;
- return g_build_filename (gnumeric_data_dir, subdir, NULL);
+ return g_build_filename (gnumeric_data_dir, subdir, (char *)NULL);
 }
 
 char *
 gnm_sys_lib_dir (char const *subdir)
 {
- return g_build_filename (gnumeric_lib_dir, subdir, NULL);
+ return g_build_filename (gnumeric_lib_dir, subdir, (char *)NULL);
 }
 
 #define GLADE_SUFFIX "glade"
@@ -302,7 +302,7 @@
 
  return g_build_filename (home_dir, ".gnumeric",
  GNUMERIC_VERSION, subdir,
- NULL);
+ (char *)NULL);
 }
 
 char *
Index: lib/goffice/split/plugin-loader-module.c
===================================================================
--- lib/goffice/split/plugin-loader-module.c (revision 12090)
+++ lib/goffice/split/plugin-loader-module.c (working copy)
@@ -330,10 +330,10 @@
 
  GNM_INIT_RET_ERROR_INFO (ret_error);
  func_name_file_probe = g_strconcat (
- plugin_service_get_id (service), "_file_probe", NULL);
+ plugin_service_get_id (service), "_file_probe", (char *)NULL);
  g_module_symbol (loader_module->handle, func_name_file_probe, &module_func_file_probe);
  func_name_file_open = g_strconcat (
- plugin_service_get_id (service), "_file_open", NULL);
+ plugin_service_get_id (service), "_file_open", (char *)NULL);
  g_module_symbol (loader_module->handle, func_name_file_open, &module_func_file_open);
  if (module_func_file_open != NULL) {
  PluginServiceFileOpenerCallbacks *cbs;
@@ -395,7 +395,7 @@
 
  GNM_INIT_RET_ERROR_INFO (ret_error);
  func_name_file_save = g_strconcat (
- plugin_service_get_id (service), "_file_save", NULL);
+ plugin_service_get_id (service), "_file_save", (char *)NULL);
  g_module_symbol (loader_module->handle, func_name_file_save, &module_func_file_save);
  if (module_func_file_save != NULL) {
  PluginServiceFileSaverCallbacks *cbs;
@@ -472,7 +472,7 @@
 
  GNM_INIT_RET_ERROR_INFO (ret_error);
  fn_info_array_name = g_strconcat (
- plugin_service_get_id (service), "_functions", NULL);
+ plugin_service_get_id (service), "_functions", (char *)NULL);
  g_module_symbol (loader_module->handle, fn_info_array_name, (gpointer) &module_fn_info_array);
  if (module_fn_info_array != NULL) {
  PluginServiceFunctionGroupCallbacks *cbs;
@@ -547,7 +547,7 @@
 
  GNM_INIT_RET_ERROR_INFO (ret_error);
  func_name_get_loader_type = g_strconcat (
- plugin_service_get_id (service), "_get_loader_type", NULL);
+ plugin_service_get_id (service), "_get_loader_type", (char *)NULL);
  g_module_symbol (loader_module->handle, func_name_get_loader_type,
                  &module_func_get_loader_type);
  if (module_func_get_loader_type != NULL) {
@@ -625,7 +625,7 @@
 
  GNM_INIT_RET_ERROR_INFO (ret_error);
  ui_actions_array_name = g_strconcat (
- plugin_service_get_id (service), "_ui_actions", NULL);
+ plugin_service_get_id (service), "_ui_actions", (char *)NULL);
  g_module_symbol (loader_module->handle, ui_actions_array_name, (gpointer) &module_ui_actions_array);
  if (module_ui_actions_array == NULL) {
  *ret_error = error_info_new_printf (
Index: lib/goffice/split/plugin-service.c
===================================================================
--- lib/goffice/split/plugin-service.c (revision 12090)
+++ lib/goffice/split/plugin-service.c (working copy)
@@ -265,7 +265,7 @@
 
  GNM_INIT_RET_ERROR_INFO (ret_error);
  full_id = g_strconcat (
- gnm_plugin_get_id (service->plugin), ":", service->id, NULL);
+ gnm_plugin_get_id (service->plugin), ":", service->id, (char *)NULL);
  plugins_register_loader (full_id, service);
  g_free (full_id);
  service->is_active = TRUE;
@@ -278,7 +278,7 @@
 
  GNM_INIT_RET_ERROR_INFO (ret_error);
  full_id = g_strconcat (
- gnm_plugin_get_id (service->plugin), ":", service->id, NULL);
+ gnm_plugin_get_id (service->plugin), ":", service->id, (char *)NULL);
  plugins_register_loader (full_id, service);
  g_free (full_id);
  service->is_active = FALSE;
Index: lib/goffice/split/formats.c
===================================================================
--- lib/goffice/split/formats.c (revision 12090)
+++ lib/goffice/split/formats.c (working copy)
@@ -259,7 +259,7 @@
  post_rep = post = (char *)"";
  pre_rep = (char *)"* ";
  pre = g_strconcat ("\"", curr,
-   (space_sep ? "\" " : "\""), NULL);
+   (space_sep ? "\" " : "\""), (char *)NULL);
  } else {
  pre_rep = pre = (char *)"";
  post_rep = (char *)"* ";
Index: lib/goffice/split/plugin.c
===================================================================
--- lib/goffice/split/plugin.c (revision 12090)
+++ lib/goffice/split/plugin.c (working copy)
@@ -395,7 +395,7 @@
  g_return_val_if_fail (IS_GNM_PLUGIN (plugin), NULL);
 
  if (plugin->saved_textdomain == NULL) {
- plugin->saved_textdomain = g_strconcat ("gnumeric__", plugin->id, NULL);
+ plugin->saved_textdomain = g_strconcat ("gnumeric__", plugin->id, (char *)NULL);
  }
 
  return plugin->saved_textdomain;
@@ -719,7 +719,7 @@
  g_return_if_fail (dir_name != NULL);
 
  GNM_INIT_RET_ERROR_INFO (ret_error);
- file_name = g_build_filename (dir_name, PLUGIN_INFO_FILE_NAME, NULL);
+ file_name = g_build_filename (dir_name, PLUGIN_INFO_FILE_NAME, (char *)NULL);
  doc = xmlParseFile (file_name);
  if (doc == NULL || doc->xmlRootNode == NULL || strcmp (doc->xmlRootNode->name, "plugin") != 0) {
  if (access (file_name, R_OK) != 0) {
@@ -1270,7 +1270,7 @@
  g_return_val_if_fail (dir_name != NULL, NULL);
 
  GNM_INIT_RET_ERROR_INFO (ret_error);
- file_name = g_build_filename (dir_name, PLUGIN_INFO_FILE_NAME, NULL);
+ file_name = g_build_filename (dir_name, PLUGIN_INFO_FILE_NAME, (char *)NULL);
  file_state = get_file_state_as_string (file_name);
  if (file_state == NULL) {
  g_free (file_name);
@@ -1338,7 +1338,7 @@
 
  if (strcmp (d_name, ".") == 0 || strcmp (d_name, "..") == 0)
  continue;
- full_entry_name = g_build_filename (dir_name, d_name, NULL);
+ full_entry_name = g_build_filename (dir_name, d_name, (char *)NULL);
  pinfo = plugin_info_read_for_dir (full_entry_name, &error);
  if (pinfo != NULL) {
  GNM_SLIST_PREPEND (plugin_info_list, pinfo);
Index: lib/goffice/split/gnumeric-gconf.c
===================================================================
--- lib/goffice/split/gnumeric-gconf.c (revision 12090)
+++ lib/goffice/split/gnumeric-gconf.c (working copy)
@@ -193,7 +193,7 @@
 static GConfSchema *
 get_schema (char const *key)
 {
- char *schema_key = g_strconcat ("/schemas", key, NULL);
+ char *schema_key = g_strconcat ("/schemas", key, (char *)NULL);
  GConfSchema *schema = gconf_client_get_schema (
  gnm_app_get_gconf_client (), schema_key, NULL);
  g_free (schema_key);
Index: lib/goffice/utils/go-file.c
===================================================================
--- lib/goffice/utils/go-file.c (revision 12090)
+++ lib/goffice/utils/go-file.c (working copy)
@@ -95,7 +95,7 @@
  char *uri;
  char *current_dir = g_get_current_dir ();
  char *abs_filename =
- g_build_filename (current_dir, filename, NULL);
+ g_build_filename (current_dir, filename, (char *)NULL);
  g_return_val_if_fail (g_path_is_absolute (abs_filename), NULL);
  uri = go_filename_to_uri (abs_filename);
  g_free (current_dir);
@@ -142,7 +142,7 @@
  g_free (raw_uri);
 #else
  char *uri_basename = g_path_get_basename (uri);
- char *fake_uri = g_strconcat ("file:///", uri_basename, NULL);
+ char *fake_uri = g_strconcat ("file:///", uri_basename, (char *)NULL);
  char *filename = go_filename_from_uri (fake_uri);
  char *basename = filename ? g_path_get_basename (filename) : NULL;
  g_free (uri_basename);
@@ -178,7 +178,7 @@
 #else
  char *uri_dirname = g_path_get_dirname (uri);
  char *dir = uri_dirname ? go_filename_from_uri (uri_dirname) : NULL;
- dirname = dirname ? g_strconcat ("file://", dirname, NULL) : NULL;
+ dirname = dirname ? g_strconcat ("file://", dirname, (char *)NULL) : (char *)NULL;
  g_free (dir);
  g_free (uri_dirname);
 #endif
@@ -482,7 +482,7 @@
  if (browser != NULL) {
  gint    argc;
  gchar **argv = NULL;
- char   *cmd_line = g_strconcat (browser, " %1", NULL);
+ char   *cmd_line = g_strconcat (browser, " %1", (char *)NULL);
 
  if (g_shell_parse_argv (cmd_line, &argc, &argv, &err)) {
  /* check for '%1' in an argument and substitute the url
@@ -494,7 +494,7 @@
  if (NULL != (tmp = strstr (argv[i], "%1"))) {
  *tmp = '\0';
  tmp = g_strconcat (argv[i],
- (clean_url != NULL) ? (char const *)clean_url : url,
+ (clean_url != (char *)NULL) ? (char const *)clean_url : url,
  tmp+2, NULL);
  g_free (argv[i]);
  argv[i] = tmp;
Index: lib/goffice/graph/gog-plot-engine.c
===================================================================
--- lib/goffice/graph/gog-plot-engine.c (revision 12090)
+++ lib/goffice/graph/gog-plot-engine.c (working copy)
@@ -228,7 +228,7 @@
  if (!g_path_is_absolute (path)) {
  char const *dir = gnm_plugin_get_dir_name (
  plugin_service_get_plugin (service));
- char *tmp = g_build_filename (dir, path, NULL);
+ char *tmp = g_build_filename (dir, path, (char *)NULL);
  g_free (path);
  path = tmp;
  }
@@ -313,7 +313,7 @@
  if (!g_path_is_absolute (path)) {
  char const *dir = gnm_plugin_get_dir_name (
  plugin_service_get_plugin (service));
- char *tmp = g_build_filename (dir, path, NULL);
+ char *tmp = g_build_filename (dir, path, (char *)NULL);
  g_free (path);
  path = tmp;
  }
Index: lib/goffice/graph/gog-guru.c
===================================================================
--- lib/goffice/graph/gog-guru.c (revision 12090)
+++ lib/goffice/graph/gog-guru.c (working copy)
@@ -518,7 +518,7 @@
 cb_graph_guru_add_item (GtkWidget *w, GraphGuruState *s)
 {
  gog_object_add_by_role (s->prop_object,
- g_object_get_data (G_OBJECT (w), ROLE_KEY), NULL);
+ g_object_get_data (G_OBJECT (w), ROLE_KEY), (char *)NULL);
 }
 
 static void
@@ -925,7 +925,7 @@
  "child-removed",
  closure, FALSE);
 
- children = gog_object_get_children (obj, NULL);
+ children = gog_object_get_children (obj, (char *)NULL);
  for (ptr = children ; ptr != NULL ; ptr = ptr->next)
  populate_graph_item_list (ptr->data, select, s, &iter, FALSE);
  g_slist_free (children);
@@ -970,8 +970,8 @@
  if (canvas->current_item == NULL)
  return FALSE;
 
- g_object_get (G_OBJECT (s->sample_graph_item), "renderer", &rend, NULL);
- g_object_get (G_OBJECT (rend), "view", &view, NULL);
+ g_object_get (G_OBJECT (s->sample_graph_item), "renderer", &rend, (char *)NULL);
+ g_object_get (G_OBJECT (rend), "view", &view, (char *)NULL);
  foo_canvas_window_to_world (canvas, event->x, event->y, &x, &y);
  gog_view_info_at_point (view,
  x * canvas->pixels_per_unit, y * canvas->pixels_per_unit,
Index: lib/goffice/graph/plugins/plot_barcol/gog-1.5d.c
===================================================================
--- lib/goffice/graph/plugins/plot_barcol/gog-1.5d.c (revision 12090)
+++ lib/goffice/graph/plugins/plot_barcol/gog-1.5d.c (working copy)
@@ -227,7 +227,7 @@
  continue;
  vals[i] = go_data_vector_get_values (
  GO_DATA_VECTOR (series->base.values[1].data));
- g_object_get (G_OBJECT (series), "errors", errors + i, NULL);
+ g_object_get (G_OBJECT (series), "errors", errors + i, (char *)NULL);
  lengths[i] = go_data_vector_get_len (
  GO_DATA_VECTOR (series->base.values[1].data));
  }
@@ -459,7 +459,7 @@
  if (g_object_class_find_property (G_OBJECT_GET_CLASS (series->plot), "horizontal") == NULL)
  horizontal = FALSE;
  else
- g_object_get (G_OBJECT (series->plot), "horizontal", &horizontal, NULL);
+ g_object_get (G_OBJECT (series->plot), "horizontal", &horizontal, (char *)NULL);
  error_page = gog_error_bar_prefs (series, "errors", horizontal, dalloc, cc);
  gtk_notebook_prepend_page (book, error_page, gtk_label_new (_("Error bars")));
 }
Index: lib/goffice/graph/plugins/plot_barcol/gog-barcol-prefs.c
===================================================================
--- lib/goffice/graph/plugins/plot_barcol/gog-barcol-prefs.c (revision 12090)
+++ lib/goffice/graph/plugins/plot_barcol/gog-barcol-prefs.c (working copy)
@@ -34,13 +34,13 @@
 static void
 cb_gap_changed (GtkAdjustment *adj, GObject *barcal)
 {
- g_object_set (barcal, "gap_percentage", (int)adj->value, NULL);
+ g_object_set (barcal, "gap_percentage", (int)adj->value, (char *)NULL);
 }
 
 static void
 cb_overlap_changed (GtkAdjustment *adj, GObject *barcol)
 {
- g_object_set (barcol, "overlap_percentage", (int)adj->value, NULL);
+ g_object_set (barcol, "overlap_percentage", (int)adj->value, (char *)NULL);
 }
 
 GtkWidget *
@@ -49,7 +49,7 @@
  GtkWidget  *w;
  char const *dir = gnm_plugin_get_dir_name (
  plugins_get_plugin_by_id ("GOffice_plot_barcol"));
- char *path = g_build_filename (dir, "gog-barcol-prefs.glade", NULL);
+ char *path = g_build_filename (dir, "gog-barcol-prefs.glade", (char *)NULL);
  GladeXML *gui = gnm_glade_xml_new (cc, path, "gog_barcol_prefs", NULL);
 
  g_free (path);
Index: lib/goffice/graph/plugins/plot_surface/gog-contour-prefs.c
===================================================================
--- lib/goffice/graph/plugins/plot_surface/gog-contour-prefs.c (revision 12090)
+++ lib/goffice/graph/plugins/plot_surface/gog-contour-prefs.c (working copy)
@@ -36,7 +36,7 @@
 static void
 cb_levels_changed (GtkSpinButton *btn, GObject *plot)
 {
- g_object_set (plot, "levels", gtk_spin_button_get_value_as_int (btn), NULL);
+ g_object_set (plot, "levels", gtk_spin_button_get_value_as_int (btn), (char *)NULL);
 }
 
 GtkWidget *
@@ -45,7 +45,7 @@
  GtkWidget  *w;
  char const *dir = gnm_plugin_get_dir_name (
  plugins_get_plugin_by_id ("GOffice_plot_surface"));
- char *path = g_build_filename (dir, "gog-contour-prefs.glade", NULL);
+ char *path = g_build_filename (dir, "gog-contour-prefs.glade", (char *)NULL);
  GladeXML *gui = gnm_glade_xml_new (cc, path, "gog_contour_prefs", NULL);
 
  g_free (path);
Index: lib/goffice/graph/plugins/plot_pie/gog-pie-prefs.c
===================================================================
--- lib/goffice/graph/plugins/plot_pie/gog-pie-prefs.c (revision 12090)
+++ lib/goffice/graph/plugins/plot_pie/gog-pie-prefs.c (working copy)
@@ -33,7 +33,7 @@
 static void
 cb_element_separation_changed (GtkAdjustment *adj, GObject *element)
 {
- g_object_set (element, "separation", adj->value / 100., NULL);
+ g_object_set (element, "separation", adj->value / 100., (char *)NULL);
 }
 
 GtkWidget *
@@ -42,7 +42,7 @@
  GtkWidget  *w;
  char const *dir = gnm_plugin_get_dir_name (
  plugins_get_plugin_by_id ("GOffice_plot_pie"));
- char *path = g_build_filenam
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] Fixes sentinel warnings on GCC4

Neil Williams-2
On Sunday 04 December 2005 1:45 pm, Sjoerd Langkemper wrote:
> This patch fixes warnings like these:
> warning: missing sentinel in function call

What system are you using to build? Gcc4 has been in use by various developers
for some time without any of these warnings - they would have been noticed as
they would have halted the build. Is this 64-bit only?

> Look at this page to find at what this warning is about:
> http://www.linuxonly.nl/docs/sentinel/

I have, but the patch still doesn't make sense to me.

> This patch basically replaces NULL with (char *)NULL

I may be wrong, but that looks like a cast for no good reason and that has
caused problems before.

>          src/backend/file/gnc-backend-file.c
-    be->lockfile = g_strconcat(be->fullpath, ".LCK", NULL);
+    be->lockfile = g_strconcat(be->fullpath, ".LCK", (char *)NULL);

Sorry, to me, that looks plain wrong. The glib API for g_strconcat clearly
states NULL not (char*)NULL:
http://developer.gnome.org/doc/API/2.0/glib/glib-String-Utility-Functions.html#g-strconcat

"The variable argument list must end with NULL. If you forget the NULL,
g_strconcat() will start appending random memory junk to your string.
string1 :  The first string to add, which must not be NULL.
  ... :  a NULL-terminated list of strings to append to the string"

Absolutely no mention of (char*)NULL.

If glib required (char*)NULL, the API would mention it and provide a suitable
#define for the cast.

I fear this patch could break a lot more than it purports to fix.

--

Neil Williams
=============
http://www.data-freedom.org/
http://www.nosoftwarepatents.com/
http://www.linux.codehelp.co.uk/


_______________________________________________
gnucash-patches mailing list
[hidden email]
https://lists.gnucash.org/mailman/listinfo/gnucash-patches

attachment0 (196 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] Fixes sentinel warnings on GCC4

Derek Atkins
If you were on IRC you'd have more information on this.

Yes, it is 64-bit only.  The problem is that on some versions of gcc4
stddef.h #defined NULL as (int)0 which causes a compiler warning when
passing that into a char*.

The fix (which David is working on -- which you'd know if you were in
IRC) is to #define GNC_NULL ((gpointer)0) and then use that instead of
NULL in these places.

-derek

Quoting Neil Williams <[hidden email]>:

> On Sunday 04 December 2005 1:45 pm, Sjoerd Langkemper wrote:
>> This patch fixes warnings like these:
>> warning: missing sentinel in function call
>
> What system are you using to build? Gcc4 has been in use by various
> developers
> for some time without any of these warnings - they would have been noticed as
> they would have halted the build. Is this 64-bit only?
>
>> Look at this page to find at what this warning is about:
>> http://www.linuxonly.nl/docs/sentinel/
>
> I have, but the patch still doesn't make sense to me.
>
>> This patch basically replaces NULL with (char *)NULL
>
> I may be wrong, but that looks like a cast for no good reason and that has
> caused problems before.
>
>>          src/backend/file/gnc-backend-file.c
> -    be->lockfile = g_strconcat(be->fullpath, ".LCK", NULL);
> +    be->lockfile = g_strconcat(be->fullpath, ".LCK", (char *)NULL);
>
> Sorry, to me, that looks plain wrong. The glib API for g_strconcat clearly
> states NULL not (char*)NULL:
> http://developer.gnome.org/doc/API/2.0/glib/glib-String-Utility-Functions.html#g-strconcat
>
> "The variable argument list must end with NULL. If you forget the NULL,
> g_strconcat() will start appending random memory junk to your string.
> string1 :  The first string to add, which must not be NULL.
>  ... :  a NULL-terminated list of strings to append to the string"
>
> Absolutely no mention of (char*)NULL.
>
> If glib required (char*)NULL, the API would mention it and provide a suitable
> #define for the cast.
>
> I fear this patch could break a lot more than it purports to fix.
>
> --
>
> Neil Williams
> =============
> http://www.data-freedom.org/
> http://www.nosoftwarepatents.com/
> http://www.linux.codehelp.co.uk/
>
>



--
       Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
       Member, MIT Student Information Processing Board  (SIPB)
       URL: http://web.mit.edu/warlord/    PP-ASEL-IA     N1NWH
       [hidden email]                        PGP key available

_______________________________________________
gnucash-patches mailing list
[hidden email]
https://lists.gnucash.org/mailman/listinfo/gnucash-patches
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] Fixes sentinel warnings on GCC4

Chris Shoemaker
On Mon, Dec 05, 2005 at 04:38:40PM -0500, Derek Atkins wrote:
> If you were on IRC you'd have more information on this.
>
> Yes, it is 64-bit only.  The problem is that on some versions of gcc4
> stddef.h #defined NULL as (int)0 which causes a compiler warning when
> passing that into a char*.

I'm no expert, and I don't actually know what gcc #defines NULL to,
but I don't think this is quite right.  I don't think this is a gcc
problem.  No compiler can infer the correct type for variadic
arguments.  In a variadic argument list, a compiler *must* interpret
an unqualified "0" (which is probably what NULL is) as integer type.
Our code is just wrong for any machine where the null pointer is not a
32 bit zero, even if it's some (imaginary) 32-bit machine.

>
> The fix (which David is working on -- which you'd know if you were in
> IRC) is to #define GNC_NULL ((gpointer)0) and then use that instead of
> NULL in these places.

Hmm.  Seems a bit heavy-handed to me, but it would work.  I hope it
doesn't result in gratuitous use of GNC_NULL in the 99% of places
where NULL is fine.  

IMHO, it's better that programmers remain aware that the use of NULL
as a sentinel is "special".  IOW, *not* hiding this behavior gives a
better picture of what the code actually does, which tends to make for
better code and better programmers in the long run.  One problem I see
with GNC_NULL, is visibility.  If it's too visible, people use it
gratuitously; if it's not visible enough, people forget to use it when
they should; How to choose?  Better just to /understand/ what's going
on.

-chris

_______________________________________________
gnucash-patches mailing list
[hidden email]
https://lists.gnucash.org/mailman/listinfo/gnucash-patches
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] Fixes sentinel warnings on GCC4

Derek Atkins
Quoting Chris Shoemaker <[hidden email]>:

> On Mon, Dec 05, 2005 at 04:38:40PM -0500, Derek Atkins wrote:
>> If you were on IRC you'd have more information on this.
>>
>> Yes, it is 64-bit only.  The problem is that on some versions of gcc4
>> stddef.h #defined NULL as (int)0 which causes a compiler warning when
>> passing that into a char*.
>
> I'm no expert, and I don't actually know what gcc #defines NULL to,
> but I don't think this is quite right.  I don't think this is a gcc
> problem.  No compiler can infer the correct type for variadic
> arguments.  In a variadic argument list, a compiler *must* interpret
> an unqualified "0" (which is probably what NULL is) as integer type.
> Our code is just wrong for any machine where the null pointer is not a
> 32 bit zero, even if it's some (imaginary) 32-bit machine.

The problem is that you cannot pass a 32-bit integer into a 64-bit adddress.
On my system (32-bit, gcc-3.4.3) NULL is either defined as 0, (void*)0, or
__null depending on other #ifdefs (which I didn't go examine).  However
if the callee is expecting a 64-bit pointer and you pass it a 32-bit
integer, the compiler WILL (and SHOULD) complain.  With -Werror this
causes the build to blow out.

>> The fix (which David is working on -- which you'd know if you were in
>> IRC) is to #define GNC_NULL ((gpointer)0) and then use that instead of
>> NULL in these places.
>
> Hmm.  Seems a bit heavy-handed to me, but it would work.  I hope it
> doesn't result in gratuitous use of GNC_NULL in the 99% of places
> where NULL is fine.

I think it would only be used in the particular cases where this is an
issue.  HOWEVER....

> IMHO, it's better that programmers remain aware that the use of NULL
> as a sentinel is "special".  IOW, *not* hiding this behavior gives a
> better picture of what the code actually does, which tends to make for
> better code and better programmers in the long run.  One problem I see
> with GNC_NULL, is visibility.  If it's too visible, people use it
> gratuitously; if it's not visible enough, people forget to use it when
> they should; How to choose?  Better just to /understand/ what's going
> on.

... we're still trying to analyze the issue and figure out what's really
going on.  I.e., there's no plan to make any changes until we understand
the problem.  David just went and tried to reproduce this on an amd64
machine and could not reproduce it.  Then we hear back that these errors
are on a 32-bit machine..  (all this is on IRC, and all in the last
few minutes)..   So..  We're still trying to figure out what the REAL
problem is before we consider this a gnucash  bug.

I agree with you that this SHOULDN'T be a problem, and we SHOULDN'T
need to make this change.

> -chris

-derek

--
       Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
       Member, MIT Student Information Processing Board  (SIPB)
       URL: http://web.mit.edu/warlord/    PP-ASEL-IA     N1NWH
       [hidden email]                        PGP key available

_______________________________________________
gnucash-patches mailing list
[hidden email]
https://lists.gnucash.org/mailman/listinfo/gnucash-patches