Hi

I see these compilation warnings when compiling
vim-7.4.2250 (and older) with -Wall -Wextra:

gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK  -pthread
-I/usr/include/gtk-2.0 -I/usr/lib/x86_64-linux-gnu/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/gio-unix-2.0/ -I/usr/include/freetype2
-I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include
-I/usr/include/pixman-1 -I/usr/include/libpng12
-I/usr/include/harfbuzz     -g -O0 -Wall -Wextra -Wshadow
-Wmissing-prototypes -Wunreachable-code -U_FORTIFY_SOURCE
-D_FORTIFY_SOURCE=1       -o objects/syntax.o syntax.c
In file included from syntax.c:14:0:
syntax.c: In function ‘set_hl_attr’:
vim.h:1635:6: warning: signed and unsigned type in conditional
expression [-Wsign-compare]
      : (long_u)INVALCOLOR) \
      ^
vim.h:1659:37: note: in expansion of macro ‘GUI_FUNCTION2’
 # define GUI_MCH_GET_RGB2(pixel)    GUI_FUNCTION2(mch_get_rgb, (pixel))
                                     ^
syntax.c:9264:28: note: in expansion of macro ‘GUI_MCH_GET_RGB2’
  at_en.ae_u.cterm.fg_rgb = GUI_MCH_GET_RGB2(sgp->sg_gui_fg);
                            ^
vim.h:1636:9: warning: signed and unsigned type in conditional
expression [-Wsign-compare]
         : termgui_##f((pixel)))
         ^
vim.h:1659:37: note: in expansion of macro ‘GUI_FUNCTION2’
 # define GUI_MCH_GET_RGB2(pixel)    GUI_FUNCTION2(mch_get_rgb, (pixel))
                                     ^
syntax.c:9264:28: note: in expansion of macro ‘GUI_MCH_GET_RGB2’
  at_en.ae_u.cterm.fg_rgb = GUI_MCH_GET_RGB2(sgp->sg_gui_fg);
                            ^
vim.h:1635:6: warning: signed and unsigned type in conditional
expression [-Wsign-compare]
      : (long_u)INVALCOLOR) \
      ^
vim.h:1659:37: note: in expansion of macro ‘GUI_FUNCTION2’
 # define GUI_MCH_GET_RGB2(pixel)    GUI_FUNCTION2(mch_get_rgb, (pixel))
                                     ^
syntax.c:9265:28: note: in expansion of macro ‘GUI_MCH_GET_RGB2’
  at_en.ae_u.cterm.bg_rgb = GUI_MCH_GET_RGB2(sgp->sg_gui_bg);
                            ^
vim.h:1636:9: warning: signed and unsigned type in conditional
expression [-Wsign-compare]
         : termgui_##f((pixel)))
         ^
vim.h:1659:37: note: in expansion of macro ‘GUI_FUNCTION2’
 # define GUI_MCH_GET_RGB2(pixel)    GUI_FUNCTION2(mch_get_rgb, (pixel))
                                     ^
syntax.c:9265:28: note: in expansion of macro ‘GUI_MCH_GET_RGB2’
  at_en.ae_u.cterm.bg_rgb = GUI_MCH_GET_RGB2(sgp->sg_gui_bg);
                            ^


Attached patch fixes by removing a cast.

Regards
Dominique.

-- 
-- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.
diff --git a/src/vim.h b/src/vim.h
index 898ebb6..8d49dcd 100644
--- a/src/vim.h
+++ b/src/vim.h
@@ -1632,14 +1632,14 @@ typedef UINT32_TYPEDEF UINT32_T;
 #  define GUI_FUNCTION2(f, pixel)   (gui.in_use \
 				    ?  ((pixel) != INVALCOLOR \
 					? gui_##f((pixel)) \
-					: (long_u)INVALCOLOR) \
+					: INVALCOLOR) \
 				    : termgui_##f((pixel)))
 #  define USE_24BIT		    (gui.in_use || p_tgc)
 # else
 #  define GUI_FUNCTION(f)	    gui_##f
 #  define GUI_FUNCTION2(f,pixel)    ((pixel) != INVALCOLOR \
 				     ? gui_##f((pixel)) \
-				     : (long_u)INVALCOLOR)
+				     : INVALCOLOR)
 #  define USE_24BIT		    gui.in_use
 # endif
 #else

Raspunde prin e-mail lui