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

6.2f BETA Make_cyg.mak gobj/gui_w32.o diagnostic

Expand Messages
  • Walter Briscoe
    Microsoft Windows 2000 [Version 5.00.2195] (C) Copyright 1985-2000 Microsoft Corp. c: WFB) cd %vimsrc% C: wfb vim bld vim62f src) set oldpath=%path%
    Message 1 of 7 , Jun 1, 2003
    • 0 Attachment
      Microsoft Windows 2000 [Version 5.00.2195]
      (C) Copyright 1985-2000 Microsoft Corp.
      c:\WFB) cd %vimsrc%

      C:\wfb\vim\bld\vim62f\src) set oldpath=%path%

      C:\wfb\vim\bld\vim62f\src) path C:\cygwin\bin;%oldpath%

      C:\wfb\vim\bld\vim62f\src) set LIBS=

      C:\wfb\vim\bld\vim62f\src) C:\cygwin\bin\make -r -R USEDLL=yes -f Make_cyg.mak clean 1>nul 2>&1

      C:\wfb\vim\bld\vim62f\src) mkdir gobj

      C:\wfb\vim\bld\vim62f\src) C:\cygwin\bin\make -r -R USEDLL=yes -f Make_cyg.mak gobj/gui_w32.o
      gcc -c -O3 -fomit-frame-pointer -freg-struct-return -malign-double -DWIN32 -DPC -DHAVE_PATHDEF -DFEAT_BIG -DWINVER=0x400 -D_WIN32_WINNT=0x40
      0 -DDYNAMIC_GETTEXT -DDYNAMIC_ICONV -DFEAT_MBYTE -DFEAT_MBYTE_IME -DDYNAMIC_IME -D_MAX_PATH=256 -D__CYGWIN__ -DFEAT_CSCOPE -DFEAT_GUI_W32 -D
      FEAT_CLIPBOARD -mcpu=i386 -march=i386 -Iproto -s gui_w32.c -o gobj/gui_w32.o
      gui_w32.c: In function `gui_mch_menu_grey':
      gui_w32.c:2086: warning: cast from pointer to integer of different size
      gui_w32.c: In function `gui_mch_tearoff':
      gui_w32.c:3094: warning: cast from pointer to integer of different size

      C:\wfb\vim\bld\vim62f\src)

      Both diagnostics are from a similar construction.
      The relevant data for gui_w32.c:3094 from cpp is
      C:\wfb\vim\bld\vim62f\src) gcc -c -O3 -fomit-frame-pointer -freg-struct-return -malign-double -DWIN32 -DPC -DHAVE_PATHDEF -DFEAT_BIG -DWINVE
      R=0x400 -D_WIN32_WINNT=0x400 -DDYNAMIC_GETTEXT -DDYNAMIC_ICONV -DFEAT_MBYTE -DFEAT_MBYTE_IME -DDYNAMIC_IME -D_MAX_PATH=256 -D__CYGWIN__ -DFE
      AT_CSCOPE -DFEAT_GUI_W32 -DFEAT_CLIPBOARD -mcpu=i386 -march=i386 -Iproto -s t.c
      t.c: In function `foo':
      t.c:14: warning: cast from pointer to integer of different size

      C:\wfb\vim\bld\vim62f\src) nl -ba t.c
      1 typedef unsigned short WORD;
      2 typedef struct HMENU__{int i;}*HMENU;
      3 struct VimMenu
      4 {
      5 HMENU submenu_id;
      6 };
      7 typedef struct VimMenu vimmenu_T;
      8
      9 void
      10 foo(menu)
      11 vimmenu_T *menu;
      12 {
      13 WORD menuID;
      14 menuID = (WORD)((WORD)(menu->submenu_id) | (WORD)0x8000);
      15 }

      C:\wfb\vim\bld\vim62f\src)

      Can somebody please cast light on that cryptic 0x8000?
      A reference to an MSDN article would be twoderful!! (++Wonderful).
      I will hold off proposing a change until I can construct something to
      test the generated code for a wide range of compilers.
      --
      Walter Briscoe
    • Dan Sharp
      ... Not a definitive answer, but a search on MSDN for 0x8000 menu returns
      Message 2 of 7 , Jun 2, 2003
      • 0 Attachment
        Walter Briscoe wrote:
        > C:\wfb\vim\bld\vim62f\src) gcc -c -O3 -fomit-frame-pointer -freg-struct-return -malign-double -DWIN32 -DPC -DHAVE_PATHDEF -DFEAT_BIG -DWINVE
        > R=0x400 -D_WIN32_WINNT=0x400 -DDYNAMIC_GETTEXT -DDYNAMIC_ICONV -DFEAT_MBYTE -DFEAT_MBYTE_IME -DDYNAMIC_IME -D_MAX_PATH=256 -D__CYGWIN__ -DFE
        > AT_CSCOPE -DFEAT_GUI_W32 -DFEAT_CLIPBOARD -mcpu=i386 -march=i386 -Iproto -s t.c
        > t.c: In function `foo':
        > t.c:14: warning: cast from pointer to integer of different size
        >
        > C:\wfb\vim\bld\vim62f\src) nl -ba t.c
        > 1 typedef unsigned short WORD;
        > 2 typedef struct HMENU__{int i;}*HMENU;
        > 3 struct VimMenu
        > 4 {
        > 5 HMENU submenu_id;
        > 6 };
        > 7 typedef struct VimMenu vimmenu_T;
        > 8
        > 9 void
        > 10 foo(menu)
        > 11 vimmenu_T *menu;
        > 12 {
        > 13 WORD menuID;
        > 14 menuID = (WORD)((WORD)(menu->submenu_id) | (WORD)0x8000);
        > 15 }
        >
        > Can somebody please cast light on that cryptic 0x8000?
        > A reference to an MSDN article would be twoderful!! (++Wonderful).

        Not a definitive answer, but a search on MSDN for '0x8000 menu' returns
        http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/windowing/windows/windowreference/windowfunctions/findwindowex.asp

        -----
        An application can call this function in the following way.

        FindWindowEx( NULL, NULL, MAKEINTATOM(0x8000), NULL );

        0x8000 is the atom for a menu class.
        -----

        Dan Sharp
      • Walter Briscoe
        In message of Mon, 2 Jun 2003 11:17:24 in , Dan Sharp writes ... Thanks Dan for that
        Message 3 of 7 , Jun 4, 2003
        • 0 Attachment
          In message <3EDB6A84.8060204@...> of Mon, 2 Jun 2003
          11:17:24 in , Dan Sharp <dwsharp@...> writes
          >Walter Briscoe wrote:
          >> 14 menuID = (WORD)((WORD)(menu->submenu_id) | (WORD)0x8000);
          >> 15 }
          >> Can somebody please cast light on that cryptic 0x8000?
          >> A reference to an MSDN article would be twoderful!! (++Wonderful).
          >
          >Not a definitive answer, but a search on MSDN for '0x8000 menu' returns
          >http://msdn.microsoft.com/library/default.asp?url=/library/en-
          >us/winui/winui/windowsuserinterface/windowing/windows/windowreference/w
          >indowfunctions/findwindowex.asp
          >
          >-----
          >An application can call this function in the following way.
          >
          >FindWindowEx( NULL, NULL, MAKEINTATOM(0x8000), NULL );
          >
          >0x8000 is the atom for a menu class.

          Thanks Dan for that response. I remain in darkness! Curiously, that text
          is absent from the October 2001 MSDN I have here.

          I started dealing with the problem in a vim 6.2 environment
          The code in question is in src/gui_w32.c.
          That file is compiled by
          Make_bc5.mak Make_cyg.mak Make_ivc.mak Make_ming.mak Make_mvc.mak

          I wrote a special version of uninstal.c to exercise the code with all
          those makefiles.

          I built and tested it. On the way, I found the Make_ivc.mak clean rule
          does not clean uninstal.exe. I have reported and fixed that in another
          thread. I also found that Make_[im]vc.mak would not build uninstal.exe
          using this technique. I shall not NOW deal with those discrepancies.

          The test file was
          C:\wfb\vim\bld\vim62.2\src) type uninstal.c
          # define WIN3264
          # include <windows.h>
          #include "vim.h"

          WORD
          foo0(vimmenu_T *menu)
          {
          WORD menuID;
          menuID = (WORD)((WORD) (menu->submenu_id) | (WORD) 0x8000);
          return menuID;
          }

          WORD
          foo1(vimmenu_T *menu)
          {
          WORD menuID;
          menuID = (WORD)((DWORD)(menu->submenu_id) | (DWORD)0x8000);
          return menuID;
          }

          #undef NDEBUG
          #include <assert.h>
          #include <stdio.h>

          int
          main(void)
          {
          vimmenu_T allf, zero;
          WORD a, z;
          WORD f0a, f0z;
          WORD f1a, f1z;

          allf.submenu_id = (void*)-1, zero.submenu_id = (void*)0;
          a = 0xffff, z = 0x8000;
          f0a = foo0(&allf), f0z = foo0(&zero);
          f1a = foo1(&allf), f1z = foo1(&zero);

          fprintf(stderr, "f0a = 0x%lx\t" "f0z = 0x%lx\n", (unsigned long)f0a, (unsigned long)f1z);
          fprintf(stderr, "f1a = 0x%lx\t" "f1z = 0x%lx\n", (unsigned long)f1a, (unsigned long)f1z);
          fprintf(stderr, "a = 0x%lx\t" "z = 0x%lx\n", (unsigned long)(WORD)0xffff, (unsigned long)(WORD)0x8000);

          assert(0xffff == foo0(&allf)); assert(0x8000 == foo0(&zero));

          assert(0xffff == foo1(&allf)); assert(0x8000 == foo1(&zero));

          return 0;
          }

          C:\wfb\vim\bld\vim62.2\src)

          A diagnostic was produced when compiling with C:\cygwin\bin\make and
          C:\PF\MinGW\bin\mingw32-make applied to Make_cyg.mak. I have not
          established why no diagnostic is produced for
          "C:\PF\MinGW\bin\mingw32-make -f Make_ming.mak". There would seem to be
          a lack of consistency somewhere!

          Each instance of the program behaved as expected.
          C:\wfb\vim\bld\vim62.2\src) uninstal.exe
          f0a = 0xffff f0z = 0x8000
          f1a = 0xffff f1z = 0x8000
          a = 0xffff z = 0x8000

          C:\wfb\vim\bld\vim62.2\src)

          No diagnostic was produced with the new code alone.

          I altered the gui_w32 source and confirmed that compilation was quiet in
          each makefile. Here is the patch:
          *** src/gui_w32.c.0 Sun Jun 1 12:37:06 2003
          --- src/gui_w32.c Wed Jun 4 15:57:28 2003
          ***************
          *** 2093,2099 ****
          if (menu->children == NULL)
          menuID = (WORD)(menu->id);
          else
          ! menuID = (WORD)((WORD)(menu->submenu_id) | (WORD)0x8000);
          menuHandle = GetDlgItem(menu->parent->tearoff_handle, menuID);
          if (menuHandle)
          EnableWindow(menuHandle, !grey);
          --- 2093,2099 ----
          if (menu->children == NULL)
          menuID = (WORD)(menu->id);
          else
          ! menuID = (WORD)((DWORD)(menu->submenu_id) | (DWORD)0x8000);
          menuHandle = GetDlgItem(menu->parent->tearoff_handle, menuID);
          if (menuHandle)
          EnableWindow(menuHandle, !grey);
          ***************
          *** 3101,3107 ****
          else
          {
          len += (int)STRLEN(TEAROFF_SUBMENU_LABEL);
          ! menuID = (WORD)((WORD)(menu->submenu_id) | (WORD)0x8000);
          }

          /* Allocate menu label and fill it in */
          --- 3101,3107 ----
          else
          {
          len += (int)STRLEN(TEAROFF_SUBMENU_LABEL);
          ! menuID = (WORD)((DWORD)(menu->submenu_id) | (DWORD)0x8000);
          }

          /* Allocate menu label and fill it in */

          --
          Walter Briscoe
        • Bram Moolenaar
          ... Looks good. I ll include this. -- ... /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net /// Creator of Vim - Vi IMproved
          Message 4 of 7 , Jun 5, 2003
          • 0 Attachment
            Walter Briscoe wrote:

            > I altered the gui_w32 source and confirmed that compilation was quiet in
            > each makefile. Here is the patch:

            Looks good. I'll include this.

            --
            From "know your smileys":
            :-& Eating spaghetti

            /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
            /// Creator of Vim - Vi IMproved -- http://www.Vim.org \\\
            \\\ Project leader for A-A-P -- http://www.A-A-P.org ///
            \\\ Help AIDS victims, buy at Amazon -- http://ICCF.nl/click1.html ///
          • Walter Briscoe
            In message of Wed, 4 Jun 2003 16:29:39 in , Walter Briscoe writes ... [snip] ... I have now
            Message 5 of 7 , Jun 5, 2003
            • 0 Attachment
              In message <xH0bnjAjBh3+EwPq@...> of Wed, 4 Jun 2003
              16:29:39 in , Walter Briscoe <wbriscoe@...> writes
              >In message <3EDB6A84.8060204@...> of Mon, 2 Jun 2003
              >11:17:24 in , Dan Sharp <dwsharp@...> writes
              >>Walter Briscoe wrote:
              >>> 14 menuID = (WORD)((WORD)(menu->submenu_id) | (WORD)0x8000);
              >>> 15 }
              [snip]

              >A diagnostic was produced when compiling with C:\cygwin\bin\make and
              >C:\PF\MinGW\bin\mingw32-make applied to Make_cyg.mak. I have not
              >established why no diagnostic is produced for
              >"C:\PF\MinGW\bin\mingw32-make -f Make_ming.mak". There would seem to be
              >a lack of consistency somewhere!

              I have now established how that diagnostic (and others) are suppressed
              in Make_ming.mak. gcc is called with a -w argument. This seems to be an
              issue where others have the expertise. I know from off-list conversation
              that you, Dan (Sharp) are looking at Make_cyg.mak and Make_ming.mak.
              Can I push this in your direction?

              I include a "typescript" file. Unfortunately, I have failed to find a
              winDoze port of the non-standard UNIX script program "script" which
              captures all characters echoed to the screen. I get some of its
              behaviour by setting the cmd.exe Screen Buffer Size to 140*2048 while
              retaining the Window Size to 140*60. (Right click the top margin of the
              command window to get at such facilities.)


              [ Section: 1/1 File: typescript.gz UUencoded by: Turnpike 6.02 ]

              begin 644 typescript.gz
              M'XL(")0ZWSX"`W1Y<&5S8W)I<'0`Y51=3]M`$'Q'XC^LD!#J@VEP/H`@'A+'
              M"19)'!$W+M))QK'/]K7V77H^X\*O[SHDU(":(K52'RI%NIV=S<[NW"5&EY31
              MDMRSC"S3L#H[.LEE\`%6ODK@4*1A%1SN[^WO&;^LI4$BZK55)>-<D?PA5S1K
              MZA?;S'-`YAN*N$N:701/O9>,5Q6S(;'F":.H8K7;,Y/,I(BEGVTX5[^^N=[$
              M\V+E")'F&SA9S(EA3R;VE&1Y2._/STC?FM;(A?$FM:EW;'L\)ZXUG3H5Z0[[
              MU3B[%U^;M.G$^,A=+_!.TT*:0BR67TA<,*]LZL=B9_VN5J\F(!GC,7;4,O\K
              M!2V""9Y>E3S&S%KT8TTT#@+0\&.MI%`"M`%ZT-3QG!E/8&'>7#:^-UJ-!F)O
              MS7IKGWYFKWH+TYOUG*N!.40X-'N.U[=&6V9D.H[YV=G"L6WTQJ9WA7AP.^U-
              M+*-6L?ZN,3?LF;E%HT^6YZY'>B+'UJQO]VX&V\2D?^N8+X!G3<Q:]U?(L*<+
              MT%9LA>Z4@#;)(+EDS;,.QL&JN&2=*G3]-`7-;J*#(F-*B_`%4FTE&%=48E+2
              M6,N5+`*E2:H*R:M.*8NY%HIBF6+O'+8VH[WBC?&[KK3;!2?Q%91^#M\*1M4Q
              M3$4)LN"@$@HYC@*!R#*?AU`RE8A"P8%6'NSJ^7]?]+^ZY6>R"Q:'J."!8H+#
              M797/@L0+I5]ZJ(`_SZ-NO?RD?=KJX@.0'*DNW/$CR%B<*%A2*'(:0H$$4PRG
              M>43$JI?!\F>%WRMGE!=>+.G#2UV]<=ZIZ09^KB"2(H.M*?AVJB#&4$00LBBB
              MDG(%.<[QCGUQ8/%J55UOG=97381DCRX+5?*W=U;4ER**7LHW3QJM/]AXY[_V
              +_MX/Y6_1KV0'````
              `
              end

              sum -r/size 37055/978 section (from "begin" to "end")
              sum -r/size 51405/686 entire input file

              --
              Walter Briscoe
            • Bill McCarthy
              ... I see it was in the make for 6.1 also - the oldest version I have. Without it (building with GUI=yes) we see 16 warnings in 7 `.c` source files [This is
              Message 6 of 7 , Jun 5, 2003
              • 0 Attachment
                On Thu 5-Jun-03 9:08am-0400, Walter Briscoe wrote:

                > I have now established how that diagnostic (and others) are suppressed
                > in Make_ming.mak. gcc is called with a -w argument.

                I see it was in the make for 6.1 also - the oldest version I have.
                Without it (building with GUI=yes) we see 16 warnings in 7 `.c` source
                files [This is for the 6.2 release - Patch level 14]:

                eval.c

                eval.c:6336: warning: `s' might be used uninitialized in this function

                mbyte.c

                mbyte.c:2763: warning: `cp' might be used uninitialized in this function

                os_win32.c

                os_win32.c:245: warning: missing braces around initializer
                os_win32.c:245: warning: (near initialization for `libintl_entry[3]')

                os_mswin.c

                os_mswin.c:1656: warning: `ret' might be used uninitialized in this function
                os_mswin.c:2852: warning: `hwnd' might be used uninitialized in this function

                if_cscope.c

                if_cscope.c:1801: warning: suggest parentheses around && within ||

                gui_w32.c

                gui_w32.c:1574: warning: `n' might be used uninitialized in this function
                gui_w32.c:2096: warning: cast from pointer to integer of different size
                gui_w32.c:2247: warning: `horizWidth' might be used uninitialized in this function
                gui_w32.c:3104: warning: cast from pointer to integer of different size

                dosinst.c

                dosinst.c:460: warning: int format, long int arg (arg 3)
                dosinst.c:473: warning: int format, long int arg (arg 3)
                dosinst.c:480: warning: int format, long int arg (arg 3)
                dosinst.c:499: warning: int format, long int arg (arg 3)
                dosinst.c:1495: warning: unsigned int format, HRESULT arg (arg 2)

                --
                Best regards,
                Bill

                "Holy Scripture: A book sent down from heaven.... Holy
                Scriptures contain all that a Christian should know and
                believe, provided he adds to it a million or so commentaries.
                [Voltaire]
              • Bram Moolenaar
                ... Thanks. I think I fixed them all. I ll send out a patch for it later. -- hundred-and-one symptoms of being an internet addict: 145. You e-mail your boss,
                Message 7 of 7 , Jun 22, 2003
                • 0 Attachment
                  Bill McCarthy wrote:

                  > On Thu 5-Jun-03 9:08am-0400, Walter Briscoe wrote:
                  >
                  > > I have now established how that diagnostic (and others) are suppressed
                  > > in Make_ming.mak. gcc is called with a -w argument.
                  >
                  > I see it was in the make for 6.1 also - the oldest version I have.
                  > Without it (building with GUI=yes) we see 16 warnings in 7 `.c` source
                  > files [This is for the 6.2 release - Patch level 14]:

                  Thanks. I think I fixed them all. I'll send out a patch for it later.

                  --
                  hundred-and-one symptoms of being an internet addict:
                  145. You e-mail your boss, informing him you'll be late.

                  /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
                  /// Creator of Vim - Vi IMproved -- http://www.Vim.org \\\
                  \\\ Project leader for A-A-P -- http://www.A-A-P.org ///
                  \\\ Help AIDS victims, buy at Amazon -- http://ICCF.nl/click1.html ///
                Your message has been successfully submitted and would be delivered to recipients shortly.