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

Patch 7.4.174

Expand Messages
  • Bram Moolenaar
    Patch 7.4.174 Problem: Compiler warnings for Python interface. (Tony Mechelynck) Solution: Add type casts, initialize variable. Files:
    Message 1 of 9 , Feb 11 7:00 AM
    • 0 Attachment
      Patch 7.4.174
      Problem: Compiler warnings for Python interface. (Tony Mechelynck)
      Solution: Add type casts, initialize variable.
      Files: src/if_py_both.h


      *** ../vim-7.4.173/src/if_py_both.h 2014-01-31 14:53:59.715533645 +0100
      --- src/if_py_both.h 2014-02-11 15:57:30.678154932 +0100
      ***************
      *** 2368,2374 ****
      PyInt numreplaced = 0;
      PyInt numadded = 0;
      PyInt size;
      ! listitem_T **lis;

      size = ListLength(self);

      --- 2368,2374 ----
      PyInt numreplaced = 0;
      PyInt numadded = 0;
      PyInt size;
      ! listitem_T **lis = NULL;

      size = ListLength(self);

      ***************
      *** 2503,2510 ****
      {
      Py_DECREF(iterator);
      PyErr_FORMAT(PyExc_ValueError,
      ! N_("attempt to assign sequence of size greater then %d "
      ! "to extended slice"), slicelen);
      list_restore(numadded, numreplaced, slicelen, l, lis, lastaddedli);
      PyMem_Free(lis);
      return -1;
      --- 2503,2510 ----
      {
      Py_DECREF(iterator);
      PyErr_FORMAT(PyExc_ValueError,
      ! N_("attempt to assign sequence of size greater then %ld "
      ! "to extended slice"), (long)slicelen);
      list_restore(numadded, numreplaced, slicelen, l, lis, lastaddedli);
      PyMem_Free(lis);
      return -1;
      ***************
      *** 2516,2523 ****
      if (step != 1 && i != slicelen)
      {
      PyErr_FORMAT2(PyExc_ValueError,
      ! N_("attempt to assign sequence of size %d to extended slice "
      ! "of size %d"), i, slicelen);
      list_restore(numadded, numreplaced, slicelen, l, lis, lastaddedli);
      PyMem_Free(lis);
      return -1;
      --- 2516,2523 ----
      if (step != 1 && i != slicelen)
      {
      PyErr_FORMAT2(PyExc_ValueError,
      ! N_("attempt to assign sequence of size %ld to extended slice "
      ! "of size %ld"), (long)i, (long)slicelen);
      list_restore(numadded, numreplaced, slicelen, l, lis, lastaddedli);
      PyMem_Free(lis);
      return -1;
      *** ../vim-7.4.173/src/version.c 2014-02-11 15:47:41.382145902 +0100
      --- src/version.c 2014-02-11 15:59:04.646156372 +0100
      ***************
      *** 740,741 ****
      --- 740,743 ----
      { /* Add new patch number below this line */
      + /**/
      + 174,
      /**/

      --
      DINGO: You must spank her well and after you have spanked her you
      may deal with her as you like and then ... spank me.
      AMAZING: And spank me!
      STUNNER: And me.
      LOVELY: And me.
      "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/ \\\
      \\\ an exciting new programming language -- http://www.Zimbu.org ///
      \\\ help me help AIDS victims -- http://ICCF-Holland.org ///

      --
      --
      You received this message from the "vim_dev" maillist.
      Do not top-post! Type your reply below the text you are replying to.
      For more information, visit http://www.vim.org/maillist.php

      ---
      You received this message because you are subscribed to the Google Groups "vim_dev" group.
      To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
      For more options, visit https://groups.google.com/groups/opt_out.
    • Tony Mechelynck
      ... In incremental build for patches 173-175 I get the following: - In tiny build but not in huge build: gcc -c -I. -Iproto -DHAVE_CONFIG_H
      Message 2 of 9 , Feb 11 8:34 AM
      • 0 Attachment
        On 11/02/14 16:00, Bram Moolenaar wrote:
        >
        > Patch 7.4.174
        > Problem: Compiler warnings for Python interface. (Tony Mechelynck)
        > Solution: Add type casts, initialize variable.
        > Files: src/if_py_both.h

        In incremental build for patches 173-175 I get the following:

        - In tiny build but not in huge build:

        gcc -c -I. -Iproto -DHAVE_CONFIG_H -I/usr/local/include -O2
        -fno-strength-reduce -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
        -o objects/move.o move.c
        move.c: In function ‘scroll_cursor_halfway’:
        move.c:2104:14: warning: unused variable ‘old_topline’ [-Wunused-variable]

        - In huge build (tiny build has no Python):

        gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK -pthread
        -I/usr/include/gtk-2.0 -I/usr/lib64/gtk-2.0/include
        -I/usr/include/atk-1.0 -I/usr/include/cairo
        -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0
        -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include
        -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng14
        -pthread -DORBIT2=1 -D_REENTRANT -I/usr/include/libgnomeui-2.0
        -I/usr/include/libart-2.0 -I/usr/include/gconf/2
        -I/usr/include/gnome-keyring-1 -I/usr/include/libgnome-2.0
        -I/usr/include/libbonoboui-2.0 -I/usr/include/libgnomecanvas-2.0
        -I/usr/include/gtk-2.0 -I/usr/include/gdk-pixbuf-2.0
        -I/usr/include/gnome-vfs-2.0 -I/usr/lib64/gnome-vfs-2.0/include
        -I/usr/include/dbus-1.0 -I/usr/lib64/dbus-1.0/include
        -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include
        -I/usr/include/orbit-2.0 -I/usr/include/libbonobo-2.0
        -I/usr/include/bonobo-activation-2.0 -I/usr/include/libxml2
        -I/usr/include/pango-1.0 -I/usr/include/gail-1.0
        -I/usr/include/freetype2 -I/usr/include/atk-1.0
        -I/usr/lib64/gtk-2.0/include -I/usr/include/cairo
        -I/usr/include/pixman-1 -I/usr/include/libpng14 -O2
        -fno-strength-reduce -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
        -I/usr/include -D_LARGEFILE64_SOURCE=1 -I/usr/include/python2.7
        -DPYTHON_HOME='"/usr"' -pthread -fPIE -o objects/if_python.o if_python.c
        In file included from if_python.c:809:0:
        if_py_both.h: In function ‘_DictionaryItem’:
        if_py_both.h:1620:2: warning: dereferencing type-punned pointer will
        break strict-aliasing rules [-Wstrict-aliasing]


        Best regards,
        Tony.
        --
        Use at own risk.

        --
        --
        You received this message from the "vim_dev" maillist.
        Do not top-post! Type your reply below the text you are replying to.
        For more information, visit http://www.vim.org/maillist.php

        ---
        You received this message because you are subscribed to the Google Groups "vim_dev" group.
        To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
        For more options, visit https://groups.google.com/groups/opt_out.
      • Bram Moolenaar
        ... I know how to fix the unused variable problem. I do not get the other error myself. Can you please check if this works around it: else if (flags &
        Message 3 of 9 , Feb 11 9:42 AM
        • 0 Attachment
          Tony Mechelynck wrote:

          > On 11/02/14 16:00, Bram Moolenaar wrote:
          > >
          > > Patch 7.4.174
          > > Problem: Compiler warnings for Python interface. (Tony Mechelynck)
          > > Solution: Add type casts, initialize variable.
          > > Files: src/if_py_both.h
          >
          > In incremental build for patches 173-175 I get the following:
          >
          > - In tiny build but not in huge build:

          I know how to fix the unused variable problem.

          I do not get the other error myself. Can you please check if this works
          around it:

          else if (flags & DICT_FLAG_RETURN_BOOL)
          {
          ret = Py_True;
          Py_INCREF(ret);
          return ret;
          }


          --
          You cannot propel yourself forward by patting yourself on the back.

          /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
          /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
          \\\ an exciting new programming language -- http://www.Zimbu.org ///
          \\\ help me help AIDS victims -- http://ICCF-Holland.org ///

          --
          --
          You received this message from the "vim_dev" maillist.
          Do not top-post! Type your reply below the text you are replying to.
          For more information, visit http://www.vim.org/maillist.php

          ---
          You received this message because you are subscribed to the Google Groups "vim_dev" group.
          To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
          For more options, visit https://groups.google.com/groups/opt_out.
        • ZyX
          PyErr_Format( %ld ) is supported since python 2.5. Officially we support python 2.4 and older. Thus you should either drop support for python 2.4 or cast to
          Message 4 of 9 , Feb 11 11:54 AM
          • 0 Attachment
            PyErr_Format("%ld") is supported since python 2.5. Officially we support python 2.4 and older. Thus you should either drop support for python 2.4 or cast to (int). I was using the latter, though I cannot recall whether I just forgot to add type casts when transforming %ld I wanted to use initially to %d or there is some reason to do so.

            --
            --
            You received this message from the "vim_dev" maillist.
            Do not top-post! Type your reply below the text you are replying to.
            For more information, visit http://www.vim.org/maillist.php

            ---
            You received this message because you are subscribed to the Google Groups "vim_dev" group.
            To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
            For more options, visit https://groups.google.com/groups/opt_out.
          • ZyX
            ... Some search reveals that I do have casts to (int) in a number of places, just these two are missing them. This would correct: diff -r bae71e70150b
            Message 5 of 9 , Feb 11 12:00 PM
            • 0 Attachment
              On Tuesday, February 11, 2014 11:54:46 PM UTC+4, ZyX wrote:
              > PyErr_Format("%ld") is supported since python 2.5. Officially we support python 2.4 and older. Thus you should either drop support for python 2.4 or cast to (int). I was using the latter, though I cannot recall whether I just forgot to add type casts when transforming %ld I wanted to use initially to %d or there is some reason to do so.

              Some search reveals that I do have casts to (int) in a number of places, just these two are missing them. This would correct:

              diff -r bae71e70150b src/if_py_both.h
              --- a/src/if_py_both.h Tue Feb 11 19:33:07 2014 +0100
              +++ b/src/if_py_both.h Wed Feb 12 00:02:33 2014 +0400
              @@ -2509,8 +2509,8 @@
              {
              Py_DECREF(iterator);
              PyErr_FORMAT(PyExc_ValueError,
              - N_("attempt to assign sequence of size greater then %ld "
              - "to extended slice"), (long)slicelen);
              + N_("attempt to assign sequence of size greater then %d "
              + "to extended slice"), (int) slicelen);
              list_restore(numadded, numreplaced, slicelen, l, lis, lastaddedli);
              PyMem_Free(lis);
              return -1;
              @@ -2522,8 +2522,8 @@
              if (step != 1 && i != slicelen)
              {
              PyErr_FORMAT2(PyExc_ValueError,
              - N_("attempt to assign sequence of size %ld to extended slice "
              - "of size %ld"), (long)i, (long)slicelen);
              + N_("attempt to assign sequence of size %d to extended slice "
              + "of size %d"), (int) i, (int) slicelen);
              list_restore(numadded, numreplaced, slicelen, l, lis, lastaddedli);
              PyMem_Free(lis);
              return -1;

              --
              --
              You received this message from the "vim_dev" maillist.
              Do not top-post! Type your reply below the text you are replying to.
              For more information, visit http://www.vim.org/maillist.php

              ---
              You received this message because you are subscribed to the Google Groups "vim_dev" group.
              To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
              For more options, visit https://groups.google.com/groups/opt_out.
            • Bram Moolenaar
              ... Thanks, it s better to keep it consistent. I didn t %ld wasn t supported by older Python versions. -- An extraordinary TALL KNIGHT in all black (possibly
              Message 6 of 9 , Feb 11 2:14 PM
              • 0 Attachment
                ZyX wrote:

                > On Tuesday, February 11, 2014 11:54:46 PM UTC+4, ZyX wrote:
                > > PyErr_Format("%ld") is supported since python 2.5. Officially we support python 2.4 and older. Thus you should either drop support for python 2.4 or cast to (int). I was using the latter, though I cannot recall whether I just forgot to add type casts when transforming %ld I wanted to use initially to %d or there is some reason to do so.
                >
                > Some search reveals that I do have casts to (int) in a number of
                > places, just these two are missing them. This would correct:

                Thanks, it's better to keep it consistent. I didn't %ld wasn't
                supported by older Python versions.


                --
                An extraordinary TALL KNIGHT in all black (possibly John with Mike on his
                shoulders) walks out from the dark trees. He is extremely fierce and
                gruesome countenance. He walks towards KING ARTHUR and PATSY, who are
                wazzing like mad. (Salopian slang, meaning very scared. almost to the
                point of wetting oneself, e.g. before an important football match or
                prior to a postering. Salopian slang meaning a beating by the school
                praeposters. Sorry about the Salopian slant to this stage direction - Ed.)
                "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/ \\\
                \\\ an exciting new programming language -- http://www.Zimbu.org ///
                \\\ help me help AIDS victims -- http://ICCF-Holland.org ///

                --
                --
                You received this message from the "vim_dev" maillist.
                Do not top-post! Type your reply below the text you are replying to.
                For more information, visit http://www.vim.org/maillist.php

                ---
                You received this message because you are subscribed to the Google Groups "vim_dev" group.
                To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
                For more options, visit https://groups.google.com/groups/opt_out.
              • Tony Mechelynck
                ... # python --version Python 2.7.3 I ll try the change suggested by Bram, and then your patch if it doesn t work. Best regards, Tony. -- YOUR FOAMY FUTURE by
                Message 7 of 9 , Feb 11 4:21 PM
                • 0 Attachment
                  On 11/02/14 20:54, ZyX wrote:
                  > PyErr_Format("%ld") is supported since python 2.5. Officially we support python 2.4 and older. Thus you should either drop support for python 2.4 or cast to (int). I was using the latter, though I cannot recall whether I just forgot to add type casts when transforming %ld I wanted to use initially to %d or there is some reason to do so.
                  >

                  # python --version
                  Python 2.7.3

                  I'll try the change suggested by Bram, and then your patch if it doesn't
                  work.

                  Best regards,
                  Tony.
                  --
                  YOUR FOAMY FUTURE
                  by Miss Fortune

                  ARIES (Mar. 21 - Apr. 19)
                  Matters are not good, where you health is concerned. This Fall, be
                  sure to "walk groundly, talk profoundly, drink roundly, and sleep
                  soundly" and you will live all the days of your life.

                  TAURUS (Apr. 20 - May 20)
                  You spent a fortune on beer this past summer and now find yourself
                  in a deep depression because you can't afford even one of your favorite
                  brewskis. Don't fret too much, Taurus. To get back on your feet
                  simply miss two car payments.

                  GEMINI (May 21 - June 21)
                  You think you're falling in love with a person who has a lot in
                  common with yourself. You both prefer ales, you've both tried your
                  hand at homebrewing, and you both want to visit every new brewpub that
                  opens. Sounds impressive but remember you really don't know your
                  partner until you meet in court.

                  --
                  --
                  You received this message from the "vim_dev" maillist.
                  Do not top-post! Type your reply below the text you are replying to.
                  For more information, visit http://www.vim.org/maillist.php

                  ---
                  You received this message because you are subscribed to the Google Groups "vim_dev" group.
                  To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
                  For more options, visit https://groups.google.com/groups/opt_out.
                • Tony Mechelynck
                  ... This makes the warning disappear, yes. I m attaching the git-style patch as produced by Mercurial with the mq extension enabled. Best regards, Tony. --
                  Message 8 of 9 , Feb 11 4:44 PM
                  • 0 Attachment
                    On 11/02/14 18:42, Bram Moolenaar wrote:
                    >
                    > Tony Mechelynck wrote:
                    >
                    >> On 11/02/14 16:00, Bram Moolenaar wrote:
                    >>>
                    >>> Patch 7.4.174
                    >>> Problem: Compiler warnings for Python interface. (Tony Mechelynck)
                    >>> Solution: Add type casts, initialize variable.
                    >>> Files: src/if_py_both.h
                    >>
                    >> In incremental build for patches 173-175 I get the following:
                    >>
                    >> - In tiny build but not in huge build:
                    >
                    > I know how to fix the unused variable problem.
                    >
                    > I do not get the other error myself. Can you please check if this works
                    > around it:
                    >
                    > else if (flags & DICT_FLAG_RETURN_BOOL)
                    > {
                    > ret = Py_True;
                    > Py_INCREF(ret);
                    > return ret;
                    > }
                    >
                    >

                    This makes the warning disappear, yes. I'm attaching the git-style patch
                    as produced by Mercurial with the mq extension enabled.


                    Best regards,
                    Tony.
                    --
                    hundred-and-one symptoms of being an internet addict:
                    84. Books in your bookcase bear the names Bongo, WinSock and Inside OLE

                    --
                    --
                    You received this message from the "vim_dev" maillist.
                    Do not top-post! Type your reply below the text you are replying to.
                    For more information, visit http://www.vim.org/maillist.php

                    ---
                    You received this message because you are subscribed to the Google Groups "vim_dev" group.
                    To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
                    For more options, visit https://groups.google.com/groups/opt_out.
                  • Bram Moolenaar
                    ... Thanks for checking the fix. -- FATHER: One day, lad, all this will be yours ... PRINCE: What - the curtains? Monty Python and the Holy Grail PYTHON
                    Message 9 of 9 , Feb 12 4:20 AM
                    • 0 Attachment
                      Tony Mechelynck wrote:

                      > On 11/02/14 18:42, Bram Moolenaar wrote:
                      > >
                      > > Tony Mechelynck wrote:
                      > >
                      > >> On 11/02/14 16:00, Bram Moolenaar wrote:
                      > >>>
                      > >>> Patch 7.4.174
                      > >>> Problem: Compiler warnings for Python interface. (Tony Mechelynck)
                      > >>> Solution: Add type casts, initialize variable.
                      > >>> Files: src/if_py_both.h
                      > >>
                      > >> In incremental build for patches 173-175 I get the following:
                      > >>
                      > >> - In tiny build but not in huge build:
                      > >
                      > > I know how to fix the unused variable problem.
                      > >
                      > > I do not get the other error myself. Can you please check if this works
                      > > around it:
                      > >
                      > > else if (flags & DICT_FLAG_RETURN_BOOL)
                      > > {
                      > > ret = Py_True;
                      > > Py_INCREF(ret);
                      > > return ret;
                      > > }
                      > >
                      > >
                      >
                      > This makes the warning disappear, yes. I'm attaching the git-style patch
                      > as produced by Mercurial with the mq extension enabled.

                      Thanks for checking the fix.


                      --
                      FATHER: One day, lad, all this will be yours ...
                      PRINCE: What - the curtains?
                      "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/ \\\
                      \\\ an exciting new programming language -- http://www.Zimbu.org ///
                      \\\ help me help AIDS victims -- http://ICCF-Holland.org ///

                      --
                      --
                      You received this message from the "vim_dev" maillist.
                      Do not top-post! Type your reply below the text you are replying to.
                      For more information, visit http://www.vim.org/maillist.php

                      ---
                      You received this message because you are subscribed to the Google Groups "vim_dev" group.
                      To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
                      For more options, visit https://groups.google.com/groups/opt_out.
                    Your message has been successfully submitted and would be delivered to recipients shortly.