Loading ...
Sorry, an error occurred while loading the content.

Patch 7.2.055

Expand Messages
  • Bram Moolenaar
    Patch 7.2.055 Problem: Various compiler warnings with strict checking. Solution: Avoid the warnings by using return values and renaming. Files:
    Message 1 of 11 , Nov 28, 2008
    • 0 Attachment
      Patch 7.2.055
      Problem: Various compiler warnings with strict checking.
      Solution: Avoid the warnings by using return values and renaming.
      Files: src/diff.c, src/eval.c, src/ex_cmds.c, src/ex_docmd.c,
      src/fileio.c, src/fold.c, src/globals.h, src/gui.c,
      src/gui_at_sb.c, src/gui_gtk_x11.c, src/gui_xmdlg.c,
      src/gui_xmebw.c, src/main.c, src/mbyte.c, src/message.c,
      src/netbeans.c, src/option.c, src/os_unix.c, src/spell.c,
      src/ui.c, src/window.c


      *** ../vim-7.2.054/src/diff.c Fri Jan 18 17:39:32 2008
      --- src/diff.c Fri Nov 28 17:23:35 2008
      ***************
      *** 661,666 ****
      --- 665,671 ----
      char_u *tmp_diff;
      FILE *fd;
      int ok;
      + int io_error = FALSE;

      /* Delete all diffblocks. */
      diff_clear(curtab);
      ***************
      *** 697,714 ****
      {
      ok = FALSE;
      fd = mch_fopen((char *)tmp_orig, "w");
      ! if (fd != NULL)
      {
      ! fwrite("line1\n", (size_t)6, (size_t)1, fd);
      fclose(fd);
      fd = mch_fopen((char *)tmp_new, "w");
      ! if (fd != NULL)
      {
      ! fwrite("line2\n", (size_t)6, (size_t)1, fd);
      fclose(fd);
      diff_file(tmp_orig, tmp_new, tmp_diff);
      fd = mch_fopen((char *)tmp_diff, "r");
      ! if (fd != NULL)
      {
      char_u linebuf[LBUFLEN];

      --- 702,727 ----
      {
      ok = FALSE;
      fd = mch_fopen((char *)tmp_orig, "w");
      ! if (fd == NULL)
      ! io_error = TRUE;
      ! else
      {
      ! if (fwrite("line1\n", (size_t)6, (size_t)1, fd) != 1)
      ! io_error = TRUE;
      fclose(fd);
      fd = mch_fopen((char *)tmp_new, "w");
      ! if (fd == NULL)
      ! io_error = TRUE;
      ! else
      {
      ! if (fwrite("line2\n", (size_t)6, (size_t)1, fd) != 1)
      ! io_error = TRUE;
      fclose(fd);
      diff_file(tmp_orig, tmp_new, tmp_diff);
      fd = mch_fopen((char *)tmp_diff, "r");
      ! if (fd == NULL)
      ! io_error = TRUE;
      ! else
      {
      char_u linebuf[LBUFLEN];

      ***************
      *** 761,766 ****
      --- 774,781 ----
      }
      if (!ok)
      {
      + if (io_error)
      + EMSG(_("E810: Cannot read or write temp files"));
      EMSG(_("E97: Cannot create diffs"));
      diff_a_works = MAYBE;
      #if defined(MSWIN) || defined(MSDOS)
      ***************
      *** 925,934 ****
      {
      # ifdef TEMPDIRNAMES
      if (vim_tempdir != NULL)
      ! mch_chdir((char *)vim_tempdir);
      else
      # endif
      ! mch_chdir("/tmp");
      shorten_fnames(TRUE);
      }
      #endif
      --- 940,949 ----
      {
      # ifdef TEMPDIRNAMES
      if (vim_tempdir != NULL)
      ! ignored = mch_chdir((char *)vim_tempdir);
      else
      # endif
      ! ignored = mch_chdir("/tmp");
      shorten_fnames(TRUE);
      }
      #endif
      *** ../vim-7.2.054/src/eval.c Fri Nov 28 11:15:10 2008
      --- src/eval.c Fri Nov 28 12:23:13 2008
      ***************
      *** 10641,10647 ****
      # ifdef FEAT_WINDOWS
      win_T *wp;
      # endif
      ! int n = 1;

      if (row >= 0 && col >= 0)
      {
      --- 10641,10647 ----
      # ifdef FEAT_WINDOWS
      win_T *wp;
      # endif
      ! int winnr = 1;

      if (row >= 0 && col >= 0)
      {
      ***************
      *** 10651,10659 ****
      (void)mouse_comp_pos(win, &row, &col, &lnum);
      # ifdef FEAT_WINDOWS
      for (wp = firstwin; wp != win; wp = wp->w_next)
      ! ++n;
      # endif
      ! vimvars[VV_MOUSE_WIN].vv_nr = n;
      vimvars[VV_MOUSE_LNUM].vv_nr = lnum;
      vimvars[VV_MOUSE_COL].vv_nr = col + 1;
      }
      --- 10651,10659 ----
      (void)mouse_comp_pos(win, &row, &col, &lnum);
      # ifdef FEAT_WINDOWS
      for (wp = firstwin; wp != win; wp = wp->w_next)
      ! ++winnr;
      # endif
      ! vimvars[VV_MOUSE_WIN].vv_nr = winnr;
      vimvars[VV_MOUSE_LNUM].vv_nr = lnum;
      vimvars[VV_MOUSE_COL].vv_nr = col + 1;
      }
      *** ../vim-7.2.054/src/ex_cmds.c Sat Nov 15 14:10:23 2008
      --- src/ex_cmds.c Fri Nov 28 17:24:08 2008
      ***************
      *** 1941,1947 ****
      * root.
      */
      if (fp_out != NULL)
      ! (void)fchown(fileno(fp_out), st_old.st_uid, st_old.st_gid);
      #endif
      }
      }
      --- 1941,1947 ----
      * root.
      */
      if (fp_out != NULL)
      ! ignored = fchown(fileno(fp_out), st_old.st_uid, st_old.st_gid);
      #endif
      }
      }
      *** ../vim-7.2.054/src/ex_docmd.c Sat Nov 15 14:10:23 2008
      --- src/ex_docmd.c Fri Nov 28 17:26:13 2008
      ***************
      *** 8753,8760 ****
      else if (*dirnow != NUL
      && (ssop_flags & SSOP_CURDIR) && globaldir != NULL)
      {
      ! (void)mch_chdir((char *)globaldir);
      ! shorten_fnames(TRUE);
      }

      failed |= (makeopens(fd, dirnow) == FAIL);
      --- 8753,8760 ----
      else if (*dirnow != NUL
      && (ssop_flags & SSOP_CURDIR) && globaldir != NULL)
      {
      ! if (mch_chdir((char *)globaldir) == OK)
      ! shorten_fnames(TRUE);
      }

      failed |= (makeopens(fd, dirnow) == FAIL);
      *** ../vim-7.2.054/src/fileio.c Wed Nov 12 16:04:43 2008
      --- src/fileio.c Fri Nov 28 17:35:54 2008
      ***************
      *** 2214,2220 ****
      {
      /* Use stderr for stdin, makes shell commands work. */
      close(0);
      ! dup(2);
      }
      #endif

      --- 2214,2220 ----
      {
      /* Use stderr for stdin, makes shell commands work. */
      close(0);
      ! ignored = dup(2);
      }
      #endif

      ***************
      *** 3449,3455 ****
      {
      # ifdef UNIX
      # ifdef HAVE_FCHOWN
      ! fchown(fd, st_old.st_uid, st_old.st_gid);
      # endif
      if (mch_stat((char *)IObuff, &st) < 0
      || st.st_uid != st_old.st_uid
      --- 3449,3455 ----
      {
      # ifdef UNIX
      # ifdef HAVE_FCHOWN
      ! ignored = fchown(fd, st_old.st_uid, st_old.st_gid);
      # endif
      if (mch_stat((char *)IObuff, &st) < 0
      || st.st_uid != st_old.st_uid
      ***************
      *** 4365,4371 ****
      || st.st_uid != st_old.st_uid
      || st.st_gid != st_old.st_gid)
      {
      ! fchown(fd, st_old.st_uid, st_old.st_gid);
      if (perm >= 0) /* set permission again, may have changed */
      (void)mch_setperm(wfname, perm);
      }
      --- 4365,4371 ----
      || st.st_uid != st_old.st_uid
      || st.st_gid != st_old.st_gid)
      {
      ! ignored = fchown(fd, st_old.st_uid, st_old.st_gid);
      if (perm >= 0) /* set permission again, may have changed */
      (void)mch_setperm(wfname, perm);
      }
      ***************
      *** 6030,6038 ****
      {
      tbuf[FGETS_SIZE - 2] = NUL;
      #ifdef USE_CR
      ! fgets_cr((char *)tbuf, FGETS_SIZE, fp);
      #else
      ! fgets((char *)tbuf, FGETS_SIZE, fp);
      #endif
      } while (tbuf[FGETS_SIZE - 2] != NUL && tbuf[FGETS_SIZE - 2] != '\n');
      }
      --- 6030,6038 ----
      {
      tbuf[FGETS_SIZE - 2] = NUL;
      #ifdef USE_CR
      ! ignoredp = fgets_cr((char *)tbuf, FGETS_SIZE, fp);
      #else
      ! ignoredp = fgets((char *)tbuf, FGETS_SIZE, fp);
      #endif
      } while (tbuf[FGETS_SIZE - 2] != NUL && tbuf[FGETS_SIZE - 2] != '\n');
      }
      *** ../vim-7.2.054/src/fold.c Wed Aug 6 18:59:40 2008
      --- src/fold.c Fri Nov 28 12:24:16 2008
      ***************
      *** 48,54 ****
      static int foldFind __ARGS((garray_T *gap, linenr_T lnum, fold_T **fpp));
      static int foldLevelWin __ARGS((win_T *wp, linenr_T lnum));
      static void checkupdate __ARGS((win_T *wp));
      ! static void setFoldRepeat __ARGS((linenr_T lnum, long count, int open));
      static linenr_T setManualFold __ARGS((linenr_T lnum, int opening, int recurse, int *donep));
      static linenr_T setManualFoldWin __ARGS((win_T *wp, linenr_T lnum, int opening, int recurse, int *donep));
      static void foldOpenNested __ARGS((fold_T *fpr));
      --- 48,54 ----
      static int foldFind __ARGS((garray_T *gap, linenr_T lnum, fold_T **fpp));
      static int foldLevelWin __ARGS((win_T *wp, linenr_T lnum));
      static void checkupdate __ARGS((win_T *wp));
      ! static void setFoldRepeat __ARGS((linenr_T lnum, long count, int do_open));
      static linenr_T setManualFold __ARGS((linenr_T lnum, int opening, int recurse, int *donep));
      static linenr_T setManualFoldWin __ARGS((win_T *wp, linenr_T lnum, int opening, int recurse, int *donep));
      static void foldOpenNested __ARGS((fold_T *fpr));
      ***************
      *** 1241,1250 ****
      * Repeat "count" times.
      */
      static void
      ! setFoldRepeat(lnum, count, open)
      linenr_T lnum;
      long count;
      ! int open;
      {
      int done;
      long n;
      --- 1241,1250 ----
      * Repeat "count" times.
      */
      static void
      ! setFoldRepeat(lnum, count, do_open)
      linenr_T lnum;
      long count;
      ! int do_open;
      {
      int done;
      long n;
      ***************
      *** 1252,1258 ****
      for (n = 0; n < count; ++n)
      {
      done = DONE_NOTHING;
      ! (void)setManualFold(lnum, open, FALSE, &done);
      if (!(done & DONE_ACTION))
      {
      /* Only give an error message when no fold could be opened. */
      --- 1252,1258 ----
      for (n = 0; n < count; ++n)
      {
      done = DONE_NOTHING;
      ! (void)setManualFold(lnum, do_open, FALSE, &done);
      if (!(done & DONE_ACTION))
      {
      /* Only give an error message when no fold could be opened. */
      *** ../vim-7.2.054/src/globals.h Thu Sep 18 21:29:07 2008
      --- src/globals.h Fri Nov 28 17:35:50 2008
      ***************
      *** 1549,1554 ****
      --- 1549,1562 ----
      EXTERN time_t starttime;

      /*
      + * Some compilers warn for not using a return value, but in some situations we
      + * can't do anything useful with the value. Assign to this variable to avoid
      + * the warning.
      + */
      + EXTERN int ignored;
      + EXTERN char *ignoredp;
      +
      + /*
      * Optional Farsi support. Include it here, so EXTERN and INIT are defined.
      */
      #ifdef FEAT_FKMAP
      *** ../vim-7.2.054/src/gui.c Wed Aug 6 14:37:26 2008
      --- src/gui.c Fri Nov 28 18:48:31 2008
      ***************
      *** 139,145 ****
      /* The read returns when the child closes the pipe (or when
      * the child dies for some reason). */
      close(pipefd[1]);
      ! (void)read(pipefd[0], &dummy, (size_t)1);
      close(pipefd[0]);
      }

      --- 139,145 ----
      /* The read returns when the child closes the pipe (or when
      * the child dies for some reason). */
      close(pipefd[1]);
      ! ignored = (int)read(pipefd[0], &dummy, (size_t)1);
      close(pipefd[0]);
      }

      *** ../vim-7.2.054/src/gui_at_sb.c Sun Jun 13 21:37:13 2004
      --- src/gui_at_sb.c Fri Nov 28 12:19:19 2008
      ***************
      *** 1078,1083 ****
      --- 1078,1089 ----
      Cardinal *num_params; /* unused */
      {
      ScrollbarWidget sbw = (ScrollbarWidget)w;
      + /* Use a union to avoid a warning for the weird conversion from float to
      + * XtPointer. Comes from Xaw/Scrollbar.c. */
      + union {
      + XtPointer xtp;
      + float xtf;
      + } xtpf;

      if (LookAhead(w, event))
      return;
      ***************
      *** 1085,1091 ****
      /* thumbProc is not pretty, but is necessary for backwards
      compatibility on those architectures for which it work{s,ed};
      the intent is to pass a (truncated) float by value. */
      ! XtCallCallbacks(w, XtNthumbProc, *(XtPointer*)&sbw->scrollbar.top);
      XtCallCallbacks(w, XtNjumpProc, (XtPointer)&sbw->scrollbar.top);
      }

      --- 1091,1098 ----
      /* thumbProc is not pretty, but is necessary for backwards
      compatibility on those architectures for which it work{s,ed};
      the intent is to pass a (truncated) float by value. */
      ! xtpf.xtf = sbw->scrollbar.top;
      ! XtCallCallbacks(w, XtNthumbProc, xtpf.xtp);
      XtCallCallbacks(w, XtNjumpProc, (XtPointer)&sbw->scrollbar.top);
      }

      *** ../vim-7.2.054/src/gui_gtk_x11.c Tue Jul 8 12:46:08 2008
      --- src/gui_gtk_x11.c Fri Nov 28 21:06:38 2008
      ***************
      *** 4070,4083 ****

      if (mask & (XValue | YValue))
      {
      ! int w, h;
      ! gui_mch_get_screen_dimensions(&w, &h);
      ! h += p_ghr + get_menu_tool_height();
      ! w += get_menu_tool_width();
      if (mask & XNegative)
      ! x += w - pixel_width;
      if (mask & YNegative)
      ! y += h - pixel_height;
      #ifdef HAVE_GTK2
      gtk_window_move(GTK_WINDOW(gui.mainwin), x, y);
      #else
      --- 4070,4083 ----

      if (mask & (XValue | YValue))
      {
      ! int ww, hh;
      ! gui_mch_get_screen_dimensions(&ww, &hh);
      ! hh += p_ghr + get_menu_tool_height();
      ! ww += get_menu_tool_width();
      if (mask & XNegative)
      ! x += ww - pixel_width;
      if (mask & YNegative)
      ! y += hh - pixel_height;
      #ifdef HAVE_GTK2
      gtk_window_move(GTK_WINDOW(gui.mainwin), x, y);
      #else
      *** ../vim-7.2.054/src/gui_xmdlg.c Tue Jun 24 23:39:32 2008
      --- src/gui_xmdlg.c Fri Nov 28 21:04:08 2008
      ***************
      *** 369,378 ****
      char buf[TEMP_BUF_SIZE];
      XmString items[MAX_ENTRIES_IN_LIST];
      int i;
      ! int index;

      ! for (index = (int)ENCODING; index < (int)NONE; ++index)
      ! count[index] = 0;

      /* First we insert the wild char into every single list. */
      if (fix != ENCODING)
      --- 369,378 ----
      char buf[TEMP_BUF_SIZE];
      XmString items[MAX_ENTRIES_IN_LIST];
      int i;
      ! int idx;

      ! for (idx = (int)ENCODING; idx < (int)NONE; ++idx)
      ! count[idx] = 0;

      /* First we insert the wild char into every single list. */
      if (fix != ENCODING)
      ***************
      *** 503,516 ****
      /*
      * Now loop trough the remaining lists and set them up.
      */
      ! for (index = (int)NAME; index < (int)NONE; ++index)
      {
      Widget w;

      ! if (fix == (enum ListSpecifier)index)
      continue;

      ! switch ((enum ListSpecifier)index)
      {
      case NAME:
      w = data->list[NAME];
      --- 503,516 ----
      /*
      * Now loop trough the remaining lists and set them up.
      */
      ! for (idx = (int)NAME; idx < (int)NONE; ++idx)
      {
      Widget w;

      ! if (fix == (enum ListSpecifier)idx)
      continue;

      ! switch ((enum ListSpecifier)idx)
      {
      case NAME:
      w = data->list[NAME];
      ***************
      *** 525,545 ****
      w = (Widget)0; /* for lint */
      }

      ! for (i = 0; i < count[index]; ++i)
      {
      ! items[i] = XmStringCreateLocalized(list[index][i]);
      ! XtFree(list[index][i]);
      }
      XmListDeleteAllItems(w);
      ! XmListAddItems(w, items, count[index], 1);
      ! if (data->sel[index])
      {
      XmStringFree(items[0]);
      ! items[0] = XmStringCreateLocalized(data->sel[index]);
      XmListSelectItem(w, items[0], False);
      XmListSetBottomItem(w, items[0]);
      }
      ! for (i = 0; i < count[index]; ++i)
      XmStringFree(items[i]);
      }
      }
      --- 525,545 ----
      w = (Widget)0; /* for lint */
      }

      ! for (i = 0; i < count[idx]; ++i)
      {
      ! items[i] = XmStringCreateLocalized(list[idx][i]);
      ! XtFree(list[idx][i]);
      }
      XmListDeleteAllItems(w);
      ! XmListAddItems(w, items, count[idx], 1);
      ! if (data->sel[idx])
      {
      XmStringFree(items[0]);
      ! items[0] = XmStringCreateLocalized(data->sel[idx]);
      XmListSelectItem(w, items[0], False);
      XmListSetBottomItem(w, items[0]);
      }
      ! for (i = 0; i < count[idx]; ++i)
      XmStringFree(items[i]);
      }
      }
      ***************
      *** 695,708 ****
      int n;
      XmString str;
      Arg args[4];
      ! char *msg = _("no specific match");

      n = 0;
      ! str = XmStringCreateLocalized(msg);
      XtSetArg(args[n], XmNlabelString, str); ++n;
      XtSetValues(data->sample, args, n);
      apply_fontlist(data->sample);
      ! XmTextSetString(data->name, msg);
      XmStringFree(str);

      return False;
      --- 695,708 ----
      int n;
      XmString str;
      Arg args[4];
      ! char *nomatch_msg = _("no specific match");

      n = 0;
      ! str = XmStringCreateLocalized(nomatch_msg);
      XtSetArg(args[n], XmNlabelString, str); ++n;
      XtSetValues(data->sample, args, n);
      apply_fontlist(data->sample);
      ! XmTextSetString(data->name, nomatch_msg);
      XmStringFree(str);

      return False;
      ***************
      *** 886,906 ****
      {
      int i;
      int max;
      ! int index = 0;
      int size;
      ! char str[128];

      for (i = 0, max = 0; i < data->num; i++)
      {
      ! get_part(fn(data, i), 7, str);
      ! size = atoi(str);
      if ((size > max) && (size < MAX_DISPLAY_SIZE))
      {
      ! index = i;
      max = size;
      }
      }
      ! strcpy(big_font, fn(data, index));
      }
      data->old = XLoadQueryFont(XtDisplay(parent), big_font);
      data->old_list = gui_motif_create_fontlist(data->old);
      --- 886,906 ----
      {
      int i;
      int max;
      ! int idx = 0;
      int size;
      ! char buf[128];

      for (i = 0, max = 0; i < data->num; i++)
      {
      ! get_part(fn(data, i), 7, buf);
      ! size = atoi(buf);
      if ((size > max) && (size < MAX_DISPLAY_SIZE))
      {
      ! idx = i;
      max = size;
      }
      }
      ! strcpy(big_font, fn(data, idx));
      }
      data->old = XLoadQueryFont(XtDisplay(parent), big_font);
      data->old_list = gui_motif_create_fontlist(data->old);
      ***************
      *** 1217,1244 ****

      if (i != 0)
      {
      ! char name[TEMP_BUF_SIZE];
      ! char style[TEMP_BUF_SIZE];
      ! char size[TEMP_BUF_SIZE];
      ! char encoding[TEMP_BUF_SIZE];
      char *found;

      found = names[0];

      ! name_part(found, name);
      ! style_part(found, style);
      ! size_part(found, size, data->in_pixels);
      ! encoding_part(found, encoding);
      !
      ! if (strlen(name) > 0
      ! && strlen(style) > 0
      ! && strlen(size) > 0
      ! && strlen(encoding) > 0)
      {
      ! data->sel[NAME] = XtNewString(name);
      ! data->sel[STYLE] = XtNewString(style);
      ! data->sel[SIZE] = XtNewString(size);
      ! data->sel[ENCODING] = XtNewString(encoding);
      data->font_name = XtNewString(names[0]);
      display_sample(data);
      XmTextSetString(data->name, data->font_name);
      --- 1217,1244 ----

      if (i != 0)
      {
      ! char namebuf[TEMP_BUF_SIZE];
      ! char stylebuf[TEMP_BUF_SIZE];
      ! char sizebuf[TEMP_BUF_SIZE];
      ! char encodingbuf[TEMP_BUF_SIZE];
      char *found;

      found = names[0];

      ! name_part(found, namebuf);
      ! style_part(found, stylebuf);
      ! size_part(found, sizebuf, data->in_pixels);
      ! encoding_part(found, encodingbuf);
      !
      ! if (strlen(namebuf) > 0
      ! && strlen(stylebuf) > 0
      ! && strlen(sizebuf) > 0
      ! && strlen(encodingbuf) > 0)
      {
      ! data->sel[NAME] = XtNewString(namebuf);
      ! data->sel[STYLE] = XtNewString(stylebuf);
      ! data->sel[SIZE] = XtNewString(sizebuf);
      ! data->sel[ENCODING] = XtNewString(encodingbuf);
      data->font_name = XtNewString(names[0]);
      display_sample(data);
      XmTextSetString(data->name, data->font_name);
      *** ../vim-7.2.054/src/gui_xmebw.c Thu Nov 8 20:48:14 2007
      --- src/gui_xmebw.c Fri Nov 28 18:58:53 2008
      ***************
      *** 1256,1262 ****
      }
      else
      {
      ! int adjust = 0;

      #if !defined(LESSTIF_VERSION) && (XmVersion > 1002)
      /*
      --- 1256,1262 ----
      }
      else
      {
      ! adjust = 0;

      #if !defined(LESSTIF_VERSION) && (XmVersion > 1002)
      /*
      ***************
      *** 1268,1279 ****
      {
      case XmEXTERNAL_HIGHLIGHT:
      adjust = (eb->primitive.highlight_thickness -
      ! (eb->pushbutton.default_button_shadow_thickness ?
      ! Xm3D_ENHANCE_PIXEL : 0));
      break;

      case XmINTERNAL_HIGHLIGHT:
      - adjust = 0;
      break;

      default:
      --- 1268,1278 ----
      {
      case XmEXTERNAL_HIGHLIGHT:
      adjust = (eb->primitive.highlight_thickness -
      ! (eb->pushbutton.default_button_shadow_thickness
      ! ? Xm3D_ENHANCE_PIXEL : 0));
      break;

      case XmINTERNAL_HIGHLIGHT:
      break;

      default:
      *** ../vim-7.2.054/src/main.c Thu Nov 20 14:11:47 2008
      --- src/main.c Fri Nov 28 18:32:48 2008
      ***************
      *** 2372,2378 ****
      * Is there any other system that cannot do this?
      */
      close(0);
      ! dup(2);
      #endif
      }

      --- 2372,2378 ----
      * Is there any other system that cannot do this?
      */
      close(0);
      ! ignored = dup(2);
      #endif
      }

      *** ../vim-7.2.054/src/mbyte.c Thu Nov 20 17:09:09 2008
      --- src/mbyte.c Fri Nov 28 18:44:05 2008
      ***************
      *** 717,723 ****
      * where mblen() returns 0 for invalid character.
      * Therefore, following condition includes 0.
      */
      ! (void)mblen(NULL, 0); /* First reset the state. */
      if (mblen(buf, (size_t)1) <= 0)
      n = 2;
      else
      --- 717,723 ----
      * where mblen() returns 0 for invalid character.
      * Therefore, following condition includes 0.
      */
      ! ignored = mblen(NULL, 0); /* First reset the state. */
      if (mblen(buf, (size_t)1) <= 0)
      n = 2;
      else
      ***************
      *** 5278,5284 ****

      /*ARGSUSED*/
      static void
      ! preedit_start_cbproc(XIC xic, XPointer client_data, XPointer call_data)
      {
      #ifdef XIM_DEBUG
      xim_log("xim_decide_input_style()\n");
      --- 5278,5284 ----

      /*ARGSUSED*/
      static void
      ! preedit_start_cbproc(XIC thexic, XPointer client_data, XPointer call_data)
      {
      #ifdef XIM_DEBUG
      xim_log("xim_decide_input_style()\n");
      ***************
      *** 5312,5318 ****

      /*ARGSUSED*/
      static void
      ! preedit_draw_cbproc(XIC xic, XPointer client_data, XPointer call_data)
      {
      XIMPreeditDrawCallbackStruct *draw_data;
      XIMText *text;
      --- 5312,5318 ----

      /*ARGSUSED*/
      static void
      ! preedit_draw_cbproc(XIC thexic, XPointer client_data, XPointer call_data)
      {
      XIMPreeditDrawCallbackStruct *draw_data;
      XIMText *text;
      ***************
      *** 5453,5459 ****

      /*ARGSUSED*/
      static void
      ! preedit_caret_cbproc(XIC xic, XPointer client_data, XPointer call_data)
      {
      #ifdef XIM_DEBUG
      xim_log("preedit_caret_cbproc()\n");
      --- 5453,5459 ----

      /*ARGSUSED*/
      static void
      ! preedit_caret_cbproc(XIC thexic, XPointer client_data, XPointer call_data)
      {
      #ifdef XIM_DEBUG
      xim_log("preedit_caret_cbproc()\n");
      ***************
      *** 5462,5468 ****

      /*ARGSUSED*/
      static void
      ! preedit_done_cbproc(XIC xic, XPointer client_data, XPointer call_data)
      {
      #ifdef XIM_DEBUG
      xim_log("preedit_done_cbproc()\n");
      --- 5462,5468 ----

      /*ARGSUSED*/
      static void
      ! preedit_done_cbproc(XIC thexic, XPointer client_data, XPointer call_data)
      {
      #ifdef XIM_DEBUG
      xim_log("preedit_done_cbproc()\n");
      *** ../vim-7.2.054/src/message.c Sun Jul 13 19:18:44 2008
      --- src/message.c Fri Nov 28 12:26:56 2008
      ***************
      *** 4585,4645 ****
      if (remove_trailing_zeroes)
      {
      int i;
      ! char *p;

      /* Using %g or %G: remove superfluous zeroes. */
      if (fmt_spec == 'f')
      ! p = tmp + str_arg_l - 1;
      else
      {
      ! p = (char *)vim_strchr((char_u *)tmp,
      fmt_spec == 'e' ? 'e' : 'E');
      ! if (p != NULL)
      {
      /* Remove superfluous '+' and leading
      * zeroes from the exponent. */
      ! if (p[1] == '+')
      {
      /* Change "1.0e+07" to "1.0e07" */
      ! STRMOVE(p + 1, p + 2);
      --str_arg_l;
      }
      ! i = (p[1] == '-') ? 2 : 1;
      ! while (p[i] == '0')
      {
      /* Change "1.0e07" to "1.0e7" */
      ! STRMOVE(p + i, p + i + 1);
      --str_arg_l;
      }
      ! --p;
      }
      }

      ! if (p != NULL && !precision_specified)
      /* Remove trailing zeroes, but keep the one
      * just after a dot. */
      ! while (p > tmp + 2 && *p == '0' && p[-1] != '.')
      {
      ! STRMOVE(p, p + 1);
      ! --p;
      --str_arg_l;
      }
      }
      else
      {
      ! char *p;

      /* Be consistent: some printf("%e") use 1.0e+12
      * and some 1.0e+012. Remove one zero in the last
      * case. */
      ! p = (char *)vim_strchr((char_u *)tmp,
      fmt_spec == 'e' ? 'e' : 'E');
      ! if (p != NULL && (p[1] == '+' || p[1] == '-')
      ! && p[2] == '0'
      ! && vim_isdigit(p[3])
      ! && vim_isdigit(p[4]))
      {
      ! STRMOVE(p + 2, p + 3);
      --str_arg_l;
      }
      }
      --- 4585,4646 ----
      if (remove_trailing_zeroes)
      {
      int i;
      ! char *tp;

      /* Using %g or %G: remove superfluous zeroes. */
      if (fmt_spec == 'f')
      ! tp = tmp + str_arg_l - 1;
      else
      {
      ! tp = (char *)vim_strchr((char_u *)tmp,
      fmt_spec == 'e' ? 'e' : 'E');
      ! if (tp != NULL)
      {
      /* Remove superfluous '+' and leading
      * zeroes from the exponent. */
      ! if (tp[1] == '+')
      {
      /* Change "1.0e+07" to "1.0e07" */
      ! STRMOVE(tp + 1, tp + 2);
      --str_arg_l;
      }
      ! i = (tp[1] == '-') ? 2 : 1;
      ! while (tp[i] == '0')
      {
      /* Change "1.0e07" to "1.0e7" */
      ! STRMOVE(tp + i, tp + i + 1);
      --str_arg_l;
      }
      ! --tp;
      }
      }

      ! if (tp != NULL && !precision_specified)
      /* Remove trailing zeroes, but keep the one
      * just after a dot. */
      ! while (tp > tmp + 2 && *tp == '0'
      ! && tp[-1] != '.')
      {
      ! STRMOVE(tp, tp + 1);
      ! --tp;
      --str_arg_l;
      }
      }
      else
      {
      ! char *tp;

      /* Be consistent: some printf("%e") use 1.0e+12
      * and some 1.0e+012. Remove one zero in the last
      * case. */
      ! tp = (char *)vim_strchr((char_u *)tmp,
      fmt_spec == 'e' ? 'e' : 'E');
      ! if (tp != NULL && (tp[1] == '+' || tp[1] == '-')
      ! && tp[2] == '0'
      ! && vim_isdigit(tp[3])
      ! && vim_isdigit(tp[4]))
      {
      ! STRMOVE(tp + 2, tp + 3);
      --str_arg_l;
      }
      }
      *** ../vim-7.2.054/src/netbeans.c Sat Nov 15 14:10:23 2008
      --- src/netbeans.c Fri Nov 28 18:51:43 2008
      ***************
      *** 1043,1049 ****
      nbdebug(("EVT: %s", buf));
      /* nb_send(buf, "netbeans_end"); avoid "write failed" messages */
      if (sd >= 0)
      ! sock_write(sd, buf, (int)STRLEN(buf)); /* ignore errors */
      }
      }

      --- 1043,1049 ----
      nbdebug(("EVT: %s", buf));
      /* nb_send(buf, "netbeans_end"); avoid "write failed" messages */
      if (sd >= 0)
      ! ignored = sock_write(sd, buf, (int)STRLEN(buf));
      }
      }

      ***************
      *** 2277,2285 ****
      int serNum;
      int localTypeNum;
      int typeNum;
      - # ifdef NBDEBUG
      - int len;
      - # endif
      pos_T *pos;

      if (buf == NULL || buf->bufp == NULL)
      --- 2277,2282 ----
      ***************
      *** 2303,2315 ****
      pos = get_off_or_lnum(buf->bufp, &args);

      cp = (char *)args;
      ! # ifdef NBDEBUG
      ! len =
      ! # endif
      ! strtol(cp, &cp, 10);
      args = (char_u *)cp;
      # ifdef NBDEBUG
      ! if (len != -1)
      {
      nbdebug((" partial line annotation -- Not Yet Implemented!\n"));
      }
      --- 2300,2309 ----
      pos = get_off_or_lnum(buf->bufp, &args);

      cp = (char *)args;
      ! ignored = (int)strtol(cp, &cp, 10);
      args = (char_u *)cp;
      # ifdef NBDEBUG
      ! if (ignored != -1)
      {
      nbdebug((" partial line annotation -- Not Yet Implemented!\n"));
      }
      *** ../vim-7.2.054/src/option.c Sun Nov 9 13:43:25 2008
      --- src/option.c Fri Nov 28 12:27:34 2008
      ***************
      *** 8232,8244 ****
      {
      if (number == 0 && string != NULL)
      {
      ! int index;

      /* Either we are given a string or we are setting option
      * to zero. */
      ! for (index = 0; string[index] == '0'; ++index)
      ;
      ! if (string[index] != NUL || index == 0)
      {
      /* There's another character after zeros or the string
      * is empty. In both cases, we are trying to set a
      --- 8232,8244 ----
      {
      if (number == 0 && string != NULL)
      {
      ! int idx;

      /* Either we are given a string or we are setting option
      * to zero. */
      ! for (idx = 0; string[idx] == '0'; ++idx)
      ;
      ! if (string[idx] != NUL || idx == 0)
      {
      /* There's another character after zeros or the string
      * is empty. In both cases, we are trying to set a
      *** ../vim-7.2.054/src/os_unix.c Wed Nov 12 14:09:38 2008
      --- src/os_unix.c Fri Nov 28 18:39:55 2008
      ***************
      *** 315,326 ****
      {-1, "Unknown!", FALSE}
      };

      void
      mch_write(s, len)
      char_u *s;
      int len;
      {
      ! write(1, (char *)s, len);
      if (p_wd) /* Unix is too fast, slow down a bit more */
      RealWaitForChar(read_cmd_fd, p_wd, NULL);
      }
      --- 315,329 ----
      {-1, "Unknown!", FALSE}
      };

      + /*
      + * Write s[len] to the screen.
      + */
      void
      mch_write(s, len)
      char_u *s;
      int len;
      {
      ! ignored = (int)write(1, (char *)s, len);
      if (p_wd) /* Unix is too fast, slow down a bit more */
      RealWaitForChar(read_cmd_fd, p_wd, NULL);
      }
      ***************
      *** 3927,3935 ****
      */
      if (fd >= 0)
      {
      ! dup(fd); /* To replace stdin (file descriptor 0) */
      ! dup(fd); /* To replace stdout (file descriptor 1) */
      ! dup(fd); /* To replace stderr (file descriptor 2) */

      /* Don't need this now that we've duplicated it */
      close(fd);
      --- 3930,3938 ----
      */
      if (fd >= 0)
      {
      ! ignored = dup(fd); /* To replace stdin (fd 0) */
      ! ignored = dup(fd); /* To replace stdout (fd 1) */
      ! ignored = dup(fd); /* To replace stderr (fd 2) */

      /* Don't need this now that we've duplicated it */
      close(fd);
      ***************
      *** 3997,4009 ****

      /* set up stdin/stdout/stderr for the child */
      close(0);
      ! dup(pty_slave_fd);
      close(1);
      ! dup(pty_slave_fd);
      if (gui.in_use)
      {
      close(2);
      ! dup(pty_slave_fd);
      }

      close(pty_slave_fd); /* has been dupped, close it now */
      --- 4000,4012 ----

      /* set up stdin/stdout/stderr for the child */
      close(0);
      ! ignored = dup(pty_slave_fd);
      close(1);
      ! ignored = dup(pty_slave_fd);
      if (gui.in_use)
      {
      close(2);
      ! ignored = dup(pty_slave_fd);
      }

      close(pty_slave_fd); /* has been dupped, close it now */
      ***************
      *** 4014,4026 ****
      /* set up stdin for the child */
      close(fd_toshell[1]);
      close(0);
      ! dup(fd_toshell[0]);
      close(fd_toshell[0]);

      /* set up stdout for the child */
      close(fd_fromshell[0]);
      close(1);
      ! dup(fd_fromshell[1]);
      close(fd_fromshell[1]);

      # ifdef FEAT_GUI
      --- 4017,4029 ----
      /* set up stdin for the child */
      close(fd_toshell[1]);
      close(0);
      ! ignored = dup(fd_toshell[0]);
      close(fd_toshell[0]);

      /* set up stdout for the child */
      close(fd_fromshell[0]);
      close(1);
      ! ignored = dup(fd_fromshell[1]);
      close(fd_fromshell[1]);

      # ifdef FEAT_GUI
      ***************
      *** 4028,4034 ****
      {
      /* set up stderr for the child */
      close(2);
      ! dup(1);
      }
      # endif
      }
      --- 4031,4037 ----
      {
      /* set up stderr for the child */
      close(2);
      ! ignored = dup(1);
      }
      # endif
      }
      ***************
      *** 4159,4165 ****
      && (lnum !=
      curbuf->b_ml.ml_line_count
      || curbuf->b_p_eol)))
      ! write(toshell_fd, "\n", (size_t)1);
      ++lnum;
      if (lnum > curbuf->b_op_end.lnum)
      {
      --- 4162,4169 ----
      && (lnum !=
      curbuf->b_ml.ml_line_count
      || curbuf->b_p_eol)))
      ! ignored = write(toshell_fd, "\n",
      ! (size_t)1);
      ++lnum;
      if (lnum > curbuf->b_op_end.lnum)
      {
      *** ../vim-7.2.054/src/spell.c Fri Nov 28 10:08:05 2008
      --- src/spell.c Fri Nov 28 12:28:24 2008
      ***************
      *** 4950,4956 ****
      static void put_sugtime __ARGS((spellinfo_T *spin, FILE *fd));
      static int write_vim_spell __ARGS((spellinfo_T *spin, char_u *fname));
      static void clear_node __ARGS((wordnode_T *node));
      ! static int put_node __ARGS((FILE *fd, wordnode_T *node, int index, int regionmask, int prefixtree));
      static void spell_make_sugfile __ARGS((spellinfo_T *spin, char_u *wfname));
      static int sug_filltree __ARGS((spellinfo_T *spin, slang_T *slang));
      static int sug_maketable __ARGS((spellinfo_T *spin));
      --- 4950,4956 ----
      static void put_sugtime __ARGS((spellinfo_T *spin, FILE *fd));
      static int write_vim_spell __ARGS((spellinfo_T *spin, char_u *fname));
      static void clear_node __ARGS((wordnode_T *node));
      ! static int put_node __ARGS((FILE *fd, wordnode_T *node, int idx, int regionmask, int prefixtree));
      static void spell_make_sugfile __ARGS((spellinfo_T *spin, char_u *wfname));
      static int sug_filltree __ARGS((spellinfo_T *spin, slang_T *slang));
      static int sug_maketable __ARGS((spellinfo_T *spin));
      *** ../vim-7.2.054/src/ui.c Sun Sep 14 15:57:54 2008
      --- src/ui.c Fri Nov 28 19:04:36 2008
      ***************
      *** 1820,1826 ****
      #ifdef HAVE_DUP
      /* Use stderr for stdin, also works for shell commands. */
      close(0);
      ! dup(2);
      #else
      read_cmd_fd = 2; /* read from stderr instead of stdin */
      #endif
      --- 1820,1826 ----
      #ifdef HAVE_DUP
      /* Use stderr for stdin, also works for shell commands. */
      close(0);
      ! ignored = dup(2);
      #else
      read_cmd_fd = 2; /* read from stderr instead of stdin */
      #endif
      *** ../vim-7.2.054/src/window.c Sat Nov 15 14:10:23 2008
      --- src/window.c Fri Nov 28 18:46:45 2008
      ***************
      *** 4029,4042 ****
      if (mch_dirname(cwd, MAXPATHL) == OK)
      globaldir = vim_strsave(cwd);
      }
      ! mch_chdir((char *)curwin->w_localdir);
      ! shorten_fnames(TRUE);
      }
      else if (globaldir != NULL)
      {
      /* Window doesn't have a local directory and we are not in the global
      * directory: Change to the global directory. */
      ! mch_chdir((char *)globaldir);
      vim_free(globaldir);
      globaldir = NULL;
      shorten_fnames(TRUE);
      --- 4029,4042 ----
      if (mch_dirname(cwd, MAXPATHL) == OK)
      globaldir = vim_strsave(cwd);
      }
      ! if (mch_chdir((char *)curwin->w_localdir) == 0)
      ! shorten_fnames(TRUE);
      }
      else if (globaldir != NULL)
      {
      /* Window doesn't have a local directory and we are not in the global
      * directory: Change to the global directory. */
      ! ignored = mch_chdir((char *)globaldir);
      vim_free(globaldir);
      globaldir = NULL;
      shorten_fnames(TRUE);
      *** ../vim-7.2.054/src/version.c Fri Nov 28 12:05:07 2008
      --- src/version.c Fri Nov 28 21:12:42 2008
      ***************
      *** 678,679 ****
      --- 678,681 ----
      { /* Add new patch number below this line */
      + /**/
      + 55,
      /**/

      --
      PRINCE: He's come to rescue me, father.
      LAUNCELOT: (embarrassed) Well, let's not jump to conclusions ...
      "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

      /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
      /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
      \\\ download, build and distribute -- http://www.A-A-P.org ///
      \\\ help me help AIDS victims -- http://ICCF-Holland.org ///

      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_dev" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    • Tony Mechelynck
      ... [...] Works for me (Huge gvim with +gui_gtk2 +gui_gnome +perl +python +ruby +tcl -mzscheme +float +xterm_save -tag_old_static). All warnings have
      Message 2 of 11 , Nov 28, 2008
      • 0 Attachment
        On 28/11/08 21:27, Bram Moolenaar wrote:
        >
        > Patch 7.2.055
        > Problem: Various compiler warnings with strict checking.
        > Solution: Avoid the warnings by using return values and renaming.
        [...]

        Works for me (Huge gvim with +gui_gtk2 +gui_gnome +perl +python +ruby
        +tcl -mzscheme +float +xterm_save -tag_old_static).

        All warnings have disappeared except the "unavoidable" ones about:
        gui_gtk_x11.c:3420: not enough variable arguments to fit a sentinel
        a line included (by #ifdef) only for Gnome2 GUI
        if_perl.xs:463: null argument where non-null required
        a line specific to Perl ver. 5.10 (included) to 6.0 (excluded).
        ... and in the link, two messages ending in "better use 'mkstemp'" about
        the file posixmodule.c distributed with Python 2.6


        Best regards,
        Tony.
        --
        "It's bad luck to be superstitious."
        -- Andrew W. Mathis

        --~--~---------~--~----~------------~-------~--~----~
        You received this message from the "vim_dev" maillist.
        For more information, visit http://www.vim.org/maillist.php
        -~----------~----~----~----~------~----~------~--~---
      • Bram Moolenaar
        ... I don t know how to fix this one. It actually looks like a problem in the header file. Or at least incompatible between GTK versions. ... I actually
        Message 3 of 11 , Nov 29, 2008
        • 0 Attachment
          Tony Mechelynck wrote:

          > On 28/11/08 21:27, Bram Moolenaar wrote:
          > >
          > > Patch 7.2.055
          > > Problem: Various compiler warnings with strict checking.
          > > Solution: Avoid the warnings by using return values and renaming.
          > [...]
          >
          > Works for me (Huge gvim with +gui_gtk2 +gui_gnome +perl +python +ruby
          > +tcl -mzscheme +float +xterm_save -tag_old_static).
          >
          > All warnings have disappeared except the "unavoidable" ones about:
          > gui_gtk_x11.c:3420: not enough variable arguments to fit a sentinel
          > a line included (by #ifdef) only for Gnome2 GUI

          I don't know how to fix this one. It actually looks like a problem in
          the header file. Or at least incompatible between GTK versions.

          > if_perl.xs:463: null argument where non-null required
          > a line specific to Perl ver. 5.10 (included) to 6.0 (excluded).

          I actually think NULL is OK here. At least, it has always worked. I
          don't know how to pass something else, one can't simply pass an empty
          environment.

          > ... and in the link, two messages ending in "better use 'mkstemp'" about
          > the file posixmodule.c distributed with Python 2.6

          That is caused by the Python library.

          --
          Overflow on /dev/null, please empty the bit bucket.

          /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
          /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
          \\\ download, build and distribute -- http://www.A-A-P.org ///
          \\\ help me help AIDS victims -- http://ICCF-Holland.org ///

          --~--~---------~--~----~------------~-------~--~----~
          You received this message from the "vim_dev" maillist.
          For more information, visit http://www.vim.org/maillist.php
          -~----------~----~----~----~------~----~------~--~---
        • Tony Mechelynck
          ... The version installed on my system consists, among others, of: gtk2-2.14.4-3.1 gtk2-devel-2.14.4-3.1 gnome-common-2.24.0-1.8 libgnome-2.24.1-1.18
          Message 4 of 11 , Nov 29, 2008
          • 0 Attachment
            On 29/11/08 12:16, Bram Moolenaar wrote:
            > Tony Mechelynck wrote:
            >
            >> On 28/11/08 21:27, Bram Moolenaar wrote:
            >>> Patch 7.2.055
            >>> Problem: Various compiler warnings with strict checking.
            >>> Solution: Avoid the warnings by using return values and renaming.
            >> [...]
            >>
            >> Works for me (Huge gvim with +gui_gtk2 +gui_gnome +perl +python +ruby
            >> +tcl -mzscheme +float +xterm_save -tag_old_static).
            >>
            >> All warnings have disappeared except the "unavoidable" ones about:
            >> gui_gtk_x11.c:3420: not enough variable arguments to fit a sentinel
            >> a line included (by #ifdef) only for Gnome2 GUI
            >
            > I don't know how to fix this one. It actually looks like a problem in
            > the header file. Or at least incompatible between GTK versions.

            The version installed on my system consists, among others, of:
            gtk2-2.14.4-3.1
            gtk2-devel-2.14.4-3.1
            gnome-common-2.24.0-1.8
            libgnome-2.24.1-1.18
            libgnome-devel-2.24.1-1.18

            >
            >> if_perl.xs:463: null argument where non-null required
            >> a line specific to Perl ver. 5.10 (included) to 6.0 (excluded).
            >
            > I actually think NULL is OK here. At least, it has always worked. I
            > don't know how to pass something else, one can't simply pass an empty
            > environment.

            Hm, what does an empty environment consist of? Would 0L, or maybe a
            pointer to it, work OK there?

            >
            >> ... and in the link, two messages ending in "better use 'mkstemp'" about
            >> the file posixmodule.c distributed with Python 2.6
            >
            > That is caused by the Python library.

            Yeah, I know; I wouldn't blame you for something in the source of a
            module called (on my system)
            /usr/src/packages/BUILD/Python-2.6/./Modules/posixmodule.c


            Best regards,
            Tony.
            --
            Linux is just like a wigwam: no Windows, no Gates and an Apache inside.

            --~--~---------~--~----~------------~-------~--~----~
            You received this message from the "vim_dev" maillist.
            For more information, visit http://www.vim.org/maillist.php
            -~----------~----~----~----~------~----~------~--~---
          • Fran├žois Ingelrest
            ... No more warning for me, thanks. --~--~---------~--~----~------------~-------~--~----~ You received this message from the vim_dev maillist. For more
            Message 5 of 11 , Nov 30, 2008
            • 0 Attachment
              On Fri, Nov 28, 2008 at 21:27, Bram Moolenaar wrote:
              > Patch 7.2.055
              > Problem: Various compiler warnings with strict checking.
              > Solution: Avoid the warnings by using return values and renaming.
              > Files: src/diff.c, src/eval.c, src/ex_cmds.c, src/ex_docmd.c,
              > src/fileio.c, src/fold.c, src/globals.h, src/gui.c,
              > src/gui_at_sb.c, src/gui_gtk_x11.c, src/gui_xmdlg.c,
              > src/gui_xmebw.c, src/main.c, src/mbyte.c, src/message.c,
              > src/netbeans.c, src/option.c, src/os_unix.c, src/spell.c,
              > src/ui.c, src/window.c

              No more warning for me, thanks.

              --~--~---------~--~----~------------~-------~--~----~
              You received this message from the "vim_dev" maillist.
              For more information, visit http://www.vim.org/maillist.php
              -~----------~----~----~----~------~----~------~--~---
            • Dominique Pelle
              ... I see this compilation warning as well. In my Perl the header file /usr/lib/perl/5.10.0/CORE/proto.h on Ubuntu-8.10, I see: PERL_CALLCONV void
              Message 6 of 11 , Dec 2, 2008
              • 0 Attachment
                2008/11/29 Bram Moolenaar wrote:

                > Tony Mechelynck wrote:
                ...[snip...]
                >> if_perl.xs:463: null argument where non-null required
                >> a line specific to Perl ver. 5.10 (included) to 6.0 (excluded).
                >
                > I actually think NULL is OK here. At least, it has always worked. I
                > don't know how to pass something else, one can't simply pass an empty
                > environment.


                I see this compilation warning as well. In my Perl the header file
                /usr/lib/perl/5.10.0/CORE/proto.h on Ubuntu-8.10, I see:


                PERL_CALLCONV void Perl_sys_init(int* argc, char*** argv)
                __attribute__nonnull__(1)
                __attribute__nonnull__(2);

                PERL_CALLCONV void Perl_sys_init3(int* argc, char*** argv, char*** env)
                __attribute__nonnull__(1)
                __attribute__nonnull__(2)
                __attribute__nonnull__(3);


                The "__attribute__nonnull(3)" explains why we get the warning.

                We can probably call the other function Perl_sys_init(...) instead
                of Perl_sys_init3(...). The patch below gets rid of the compilation
                warning but I prefer to let the author of the Perl interface (in CC)
                verify whether it's correct.

                $ cvs diff -c if_perl.xs
                Index: if_perl.xs
                ===================================================================
                RCS file: /cvsroot/vim/vim7/src/if_perl.xs,v
                retrieving revision 1.14
                diff -c -r1.14 if_perl.xs
                *** if_perl.xs 1 Sep 2008 15:56:34 -0000 1.14
                --- if_perl.xs 2 Dec 2008 19:25:21 -0000
                ***************
                *** 460,466 ****
                static char *argv[] = { "", "-e", "" };

                #if (PERL_REVISION == 5) && (PERL_VERSION >= 10)
                ! Perl_sys_init3(&argc, (char***)&argv, NULL);
                #endif
                perl_interp = perl_alloc();
                perl_construct(perl_interp);
                --- 460,466 ----
                static char *argv[] = { "", "-e", "" };

                #if (PERL_REVISION == 5) && (PERL_VERSION >= 10)
                ! Perl_sys_init(&argc, (char***)&argv);
                #endif
                perl_interp = perl_alloc();
                perl_construct(perl_interp);

                -- Dominique

                --~--~---------~--~----~------------~-------~--~----~
                You received this message from the "vim_dev" maillist.
                For more information, visit http://www.vim.org/maillist.php
                -~----------~----~----~----~------~----~------~--~---
              • Bram Moolenaar
                ... You also need to adjust the other places where init3 appears. Otherwise it looks like a good change to avoid the warning. Question is if it also works
                Message 7 of 11 , Dec 2, 2008
                • 0 Attachment
                  Dominique Pelle wrote:

                  > 2008/11/29 Bram Moolenaar wrote:
                  >
                  > > Tony Mechelynck wrote:
                  > ...[snip...]
                  > >> if_perl.xs:463: null argument where non-null required
                  > >> a line specific to Perl ver. 5.10 (included) to 6.0 (excluded).
                  > >
                  > > I actually think NULL is OK here. At least, it has always worked. I
                  > > don't know how to pass something else, one can't simply pass an empty
                  > > environment.
                  >
                  >
                  > I see this compilation warning as well. In my Perl the header file
                  > /usr/lib/perl/5.10.0/CORE/proto.h on Ubuntu-8.10, I see:
                  >
                  >
                  > PERL_CALLCONV void Perl_sys_init(int* argc, char*** argv)
                  > __attribute__nonnull__(1)
                  > __attribute__nonnull__(2);
                  >
                  > PERL_CALLCONV void Perl_sys_init3(int* argc, char*** argv, char*** env)
                  > __attribute__nonnull__(1)
                  > __attribute__nonnull__(2)
                  > __attribute__nonnull__(3);
                  >
                  >
                  > The "__attribute__nonnull(3)" explains why we get the warning.
                  >
                  > We can probably call the other function Perl_sys_init(...) instead
                  > of Perl_sys_init3(...). The patch below gets rid of the compilation
                  > warning but I prefer to let the author of the Perl interface (in CC)
                  > verify whether it's correct.

                  You also need to adjust the other places where "init3" appears.
                  Otherwise it looks like a good change to avoid the warning. Question is
                  if it also works with all versions of Perl.

                  --
                  `When any government, or any church for that matter, undertakes to say to
                  its subjects, "This you may not read, this you must not see, this you are
                  forbidden to know," the end result is tyranny and oppression no matter how
                  holy the motives' -- Robert A Heinlein, "If this goes on --"

                  /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
                  /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
                  \\\ download, build and distribute -- http://www.A-A-P.org ///
                  \\\ help me help AIDS victims -- http://ICCF-Holland.org ///

                  --~--~---------~--~----~------------~-------~--~----~
                  You received this message from the "vim_dev" maillist.
                  For more information, visit http://www.vim.org/maillist.php
                  -~----------~----~----~----~------~----~------~--~---
                • Dominique Pelle
                  ... Perl_sys_init3(...) in Vim code appears only in between... #if (PERL_REVISION == 5) && (PERL_VERSION = 10) ... #endif And since Perl-5.10.0 is the latest
                  Message 8 of 11 , Dec 2, 2008
                  • 0 Attachment
                    2008/12/2 Bram Moolenaar <Bram@...>:

                    > Dominique Pelle wrote:
                    >
                    >> 2008/11/29 Bram Moolenaar wrote:
                    >>
                    >> > Tony Mechelynck wrote:
                    >> ...[snip...]
                    >> >> if_perl.xs:463: null argument where non-null required
                    >> >> a line specific to Perl ver. 5.10 (included) to 6.0 (excluded).
                    >> >
                    >> > I actually think NULL is OK here. At least, it has always worked. I
                    >> > don't know how to pass something else, one can't simply pass an empty
                    >> > environment.
                    >>
                    >>
                    >> I see this compilation warning as well. In my Perl the header file
                    >> /usr/lib/perl/5.10.0/CORE/proto.h on Ubuntu-8.10, I see:
                    >>
                    >>
                    >> PERL_CALLCONV void Perl_sys_init(int* argc, char*** argv)
                    >> __attribute__nonnull__(1)
                    >> __attribute__nonnull__(2);
                    >>
                    >> PERL_CALLCONV void Perl_sys_init3(int* argc, char*** argv, char*** env)
                    >> __attribute__nonnull__(1)
                    >> __attribute__nonnull__(2)
                    >> __attribute__nonnull__(3);
                    >>
                    >>
                    >> The "__attribute__nonnull(3)" explains why we get the warning.
                    >>
                    >> We can probably call the other function Perl_sys_init(...) instead
                    >> of Perl_sys_init3(...). The patch below gets rid of the compilation
                    >> warning but I prefer to let the author of the Perl interface (in CC)
                    >> verify whether it's correct.
                    >
                    > You also need to adjust the other places where "init3" appears.
                    > Otherwise it looks like a good change to avoid the warning. Question is
                    > if it also works with all versions of Perl.


                    Perl_sys_init3(...) in Vim code appears only in between...

                    #if (PERL_REVISION == 5) && (PERL_VERSION >= 10)
                    ...
                    #endif

                    And since Perl-5.10.0 is the latest version of Perl,
                    changing Perl_sys_init3 into Perl_sys_init should not
                    break anything for older versions of Perl.

                    -- Dominique

                    --~--~---------~--~----~------------~-------~--~----~
                    You received this message from the "vim_dev" maillist.
                    For more information, visit http://www.vim.org/maillist.php
                    -~----------~----~----~----~------~----~------~--~---
                  • Bram Moolenaar
                    ... I suppose it s unlikely that this will fail somewhere. I ll just send out a patch and keep fingers crossed :-). There are a few other warnings in
                    Message 9 of 11 , Dec 3, 2008
                    • 0 Attachment
                      Dominique Pelle wrote:

                      > >> 2008/11/29 Bram Moolenaar wrote:
                      > >>
                      > >> > Tony Mechelynck wrote:
                      > >> ...[snip...]
                      > >> >> if_perl.xs:463: null argument where non-null required
                      > >> >> a line specific to Perl ver. 5.10 (included) to 6.0 (excluded).
                      > >> >
                      > >> > I actually think NULL is OK here. At least, it has always worked. I
                      > >> > don't know how to pass something else, one can't simply pass an empty
                      > >> > environment.
                      > >>
                      > >>
                      > >> I see this compilation warning as well. In my Perl the header file
                      > >> /usr/lib/perl/5.10.0/CORE/proto.h on Ubuntu-8.10, I see:
                      > >>
                      > >>
                      > >> PERL_CALLCONV void Perl_sys_init(int* argc, char*** argv)
                      > >> __attribute__nonnull__(1)
                      > >> __attribute__nonnull__(2);
                      > >>
                      > >> PERL_CALLCONV void Perl_sys_init3(int* argc, char*** argv, char*** env)
                      > >> __attribute__nonnull__(1)
                      > >> __attribute__nonnull__(2)
                      > >> __attribute__nonnull__(3);
                      > >>
                      > >>
                      > >> The "__attribute__nonnull(3)" explains why we get the warning.
                      > >>
                      > >> We can probably call the other function Perl_sys_init(...) instead
                      > >> of Perl_sys_init3(...). The patch below gets rid of the compilation
                      > >> warning but I prefer to let the author of the Perl interface (in CC)
                      > >> verify whether it's correct.
                      > >
                      > > You also need to adjust the other places where "init3" appears.
                      > > Otherwise it looks like a good change to avoid the warning. Question is
                      > > if it also works with all versions of Perl.
                      >
                      >
                      > Perl_sys_init3(...) in Vim code appears only in between...
                      >
                      > #if (PERL_REVISION == 5) && (PERL_VERSION >= 10)
                      > ...
                      > #endif
                      >
                      > And since Perl-5.10.0 is the latest version of Perl,
                      > changing Perl_sys_init3 into Perl_sys_init should not
                      > break anything for older versions of Perl.

                      I suppose it's unlikely that this will fail somewhere. I'll just send
                      out a patch and keep fingers crossed :-).

                      There are a few other warnings in if_perl.xs and the generated
                      if_perl.c. I don't know how to avoid those.

                      --
                      ARTHUR: Be quiet!
                      DENNIS: --but by a two-thirds majority in the case of more--
                      ARTHUR: Be quiet! I order you to be quiet!
                      WOMAN: Order, eh -- who does he think he is?
                      ARTHUR: I am your king!
                      The Quest for the Holy Grail (Monty Python)

                      /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
                      /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
                      \\\ download, build and distribute -- http://www.A-A-P.org ///
                      \\\ help me help AIDS victims -- http://ICCF-Holland.org ///

                      --~--~---------~--~----~------------~-------~--~----~
                      You received this message from the "vim_dev" maillist.
                      For more information, visit http://www.vim.org/maillist.php
                      -~----------~----~----~----~------~----~------~--~---
                    • Tony Mechelynck
                      On 02/12/08 22:05, Dominique Pelle wrote: [...] ... Maybe that #if will break something if and when Perl 6 gets released? Hm, I suppose we can cross that
                      Message 10 of 11 , Dec 3, 2008
                      • 0 Attachment
                        On 02/12/08 22:05, Dominique Pelle wrote:
                        [...]
                        > Perl_sys_init3(...) in Vim code appears only in between...
                        >
                        > #if (PERL_REVISION == 5)&& (PERL_VERSION>= 10)
                        > ...
                        > #endif
                        >
                        > And since Perl-5.10.0 is the latest version of Perl,
                        > changing Perl_sys_init3 into Perl_sys_init should not
                        > break anything for older versions of Perl.
                        >
                        > -- Dominique

                        Maybe that #if will break something if and when Perl 6 gets released?
                        Hm, I suppose we can cross that bridge when we get to it.


                        Best regards,
                        Tony.
                        --
                        A total abstainer is one who abstains from everything but abstention,
                        and especially from inactivity in the affairs of others.
                        -- Ambrose Bierce, "The Devil's Dictionary"

                        --~--~---------~--~----~------------~-------~--~----~
                        You received this message from the "vim_dev" maillist.
                        For more information, visit http://www.vim.org/maillist.php
                        -~----------~----~----~----~------~----~------~--~---
                      • Tony Mechelynck
                        On 03/12/08 10:51, Bram Moolenaar wrote: [...] ... After applying patch 7.2.063 I don t get any warnings in if_perl.xs (when compiling if_perl.c) anymore.
                        Message 11 of 11 , Dec 3, 2008
                        • 0 Attachment
                          On 03/12/08 10:51, Bram Moolenaar wrote:
                          [...]
                          > I suppose it's unlikely that this will fail somewhere. I'll just send
                          > out a patch and keep fingers crossed :-).
                          >
                          > There are a few other warnings in if_perl.xs and the generated
                          > if_perl.c. I don't know how to avoid those.
                          >

                          After applying patch 7.2.063 I don't get any warnings in if_perl.xs
                          (when compiling if_perl.c) anymore. Maybe for other platforms...

                          Best regards,
                          Tony.
                          --
                          Pittsburgh Driver's Test

                          (7) The car directly in front of you has a flashing right tail light
                          but a steady left tail light. This means

                          (a) one of the tail lights is broken; you should blow your horn
                          to call the problem to the driver's attention.
                          (b) the driver is signaling a right turn.
                          (c) the driver is signaling a left turn.
                          (d) the driver is from out of town.

                          The correct answer is (d). Tail lights are used in some foreign
                          countries to signal turns.

                          --~--~---------~--~----~------------~-------~--~----~
                          You received this message from the "vim_dev" maillist.
                          For more information, visit http://www.vim.org/maillist.php
                          -~----------~----~----~----~------~----~------~--~---
                        Your message has been successfully submitted and would be delivered to recipients shortly.