On 14-Jan-2019 09:39, Bram Moolenaar wrote:
Patch 8.1.0743
Problem:    Giving error messages is not flexible.
Solution:   Add semsg().  Change argument from "char_u *" to "char *", also
             for msg() and get rid of most MSG macros. (Ozaki Kiichi, closes
             #3302)  Also make emsg() accept a "char *" argument.  Get rid of
             an enormous number of type casts.
Files:      src/blob.c, src/blowfish.c, src/buffer.c, src/channel.c,
             src/crypt.c, src/dict.c, src/diff.c, src/digraph.c, src/edit.c,
             src/eval.c, src/evalfunc.c, src/ex_cmds.c, src/ex_cmds.h,
             src/ex_cmds2.c, src/ex_docmd.c, src/ex_eval.c, src/ex_getln.c,
             src/farsi.h, src/fileio.c, src/fold.c, src/getchar.c,
             src/globals.h, src/gui.c, src/gui_at_fs.c, src/gui_at_sb.c,
             src/gui_beval.c, src/gui_gtk_x11.c, src/gui_mac.c,
             src/gui_photon.c, src/gui_w32.c, src/gui_x11.c, src/hangulin.c,
             src/hardcopy.c, src/hashtab.c, src/if_cscope.c, src/if_lua.c,
             src/if_mzsch.c, src/if_perl.xs, src/if_py_both.h, src/if_python.c,
             src/if_python3.c, src/if_ruby.c, src/if_tcl.c, src/if_xcmdsrv.c,
             src/json.c, src/list.c, src/main.c, src/mark.c, src/mbyte.c,
             src/memfile.c, src/memline.c, src/menu.c, src/message.c,
             src/misc1.c, src/misc2.c, src/netbeans.c, src/normal.c, src/ops.c,
             src/option.c, src/os_amiga.c, src/os_mswin.c, src/os_unix.c,
             src/os_win32.c, src/popupmnu.c, src/proto.h, src/proto/buffer.pro,
             src/proto/digraph.pro, src/proto/ex_docmd.pro,
             src/proto/ex_eval.pro, src/proto/ex_getln.pro,
             src/proto/hardcopy.pro, src/proto/mbyte.pro,
             src/proto/message.pro, src/proto/misc2.pro, src/proto/option.pro,
             src/proto/spell.pro, src/quickfix.c, src/regexp.c,
             src/regexp_nfa.c, src/search.c, src/sign.c, src/spell.c,
             src/spellfile.c, src/structs.h, src/syntax.c, src/tag.c,
             src/term.c, src/terminal.c, src/textprop.c, src/ui.c, src/undo.c,
             src/userfunc.c, src/version.c, src/vim.h, src/window.c,

After this patch, mingw-64 (gcc 8.2.1) spits out this warning:
gcc -c -I. -Iproto -DWIN32 -DWINVER=0x0603 -D_WIN32_WINNT=0x0603 -DHAVE_PATHDEF -DFEAT_NORMAL -DHAVE_STDINT_H -DFEAT_GUI_W32 -DFEAT_CLIPBOARD -pipe -march=native -Wall -O3 -fomit-frame-pointer -freg-struct-return -s mbyte.c -o gobjnative/mbyte.o
mbyte.c: In function 'mb_init':
mbyte.c:563:13: warning: pointer targets in returning 'char_u *' {aka 'unsigned char *'} from a function with return type 'char *' differ in signedness [-Wpointer-sign]
      return (char_u *)N_("E543: Not a valid codepage");
             ^

Also after this patch HP-UX spits out this warning:
    cc -c -I. -Iproto -DHAVE_CONFIG_H     -O2        -o objects/ex_docmd.o ex_docmd.c cc: "ex_docmd.c", line 2293: warning 604: Pointers are not assignment-compatible.


The attached patches try to fix both warnings.

Cheers
John

--
--
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.
--- ex_docmd.c.orig     2019-01-15 05:05:21.985013600 +1100
+++ ex_docmd.c  2019-01-15 05:25:26.466369700 +1100
@@ -2290,7 +2290,7 @@
        /* check these explicitly for a more specific error message */
        if (*ea.arg == '*' || *ea.arg == '+')
        {
-           errormsg = (char_u *)_(e_invalidreg);
+           errormsg = _(e_invalidreg);
            goto doend;
        }
 #endif
--- mbyte.c.orig        2019-01-15 05:05:22.325119600 +1100
+++ mbyte.c     2019-01-15 05:24:19.107338700 +1100
@@ -560,7 +560,7 @@
        else if (GetLastError() == ERROR_INVALID_PARAMETER)
        {
 codepage_invalid:
-           return (char_u *)N_("E543: Not a valid codepage");
+           return N_("E543: Not a valid codepage");
        }
     }
 #endif

Raspunde prin e-mail lui