On 27-Mar-2020 09:14, Bram Moolenaar wrote:
Patch 8.2.0460 (after 8.2.0459)
Problem: Build failure because of wrong feature name.
Solution: Correct feature name.
Files: src/evalfunc.c
After applying patches 8.2.0449 to 8.2.0460, HP-UX throws this error if
FEAT_FLOAT and FEAT_JOB_CHANNEL are not defined (I get an error to the
same effect from mingw64):
<snip>
cc -c -I. -Iproto -DHAVE_CONFIG_H -O2 -D_REENTRANT -o
objects/evalfunc.o evalfunc.c
cc: "evalfunc.c", line 421: error 1588: "ret_float" undefined.
cc: "evalfunc.c", line 421: error 1521: Incorrect initialization.
cc: "evalfunc.c", line 430: error 1521: Incorrect initialization.
cc: "evalfunc.c", line 443: error 1521: Incorrect initialization.
cc: "evalfunc.c", line 444: error 1521: Incorrect initialization.
cc: "evalfunc.c", line 484: error 1521: Incorrect initialization.
cc: "evalfunc.c", line 491: error 1588: "ret_job" undefined.
cc: "evalfunc.c", line 491: error 1521: Incorrect initialization.
cc: "evalfunc.c", line 495: error 1588: "ret_channel" undefined.
cc: "evalfunc.c", line 495: error 1521: Incorrect initialization.
cc: "evalfunc.c", line 515: error 1521: Incorrect initialization.
cc: "evalfunc.c", line 516: error 1521: Incorrect initialization.
cc: "evalfunc.c", line 543: error 1521: Incorrect initialization.
cc: "evalfunc.c", line 555: error 1521: Incorrect initialization.
cc: "evalfunc.c", line 556: error 1521: Incorrect initialization.
cc: "evalfunc.c", line 642: error 1521: Incorrect initialization.
cc: "evalfunc.c", line 645: error 1521: Incorrect initialization.
cc: "evalfunc.c", line 666: error 1521: Incorrect initialization.
cc: "evalfunc.c", line 667: error 1521: Incorrect initialization.
cc: "evalfunc.c", line 736: error 1521: Incorrect initialization.
cc: "evalfunc.c", line 782: error 1521: Incorrect initialization.
cc: "evalfunc.c", line 795: error 1521: Incorrect initialization.
cc: "evalfunc.c", line 852: error 1521: Incorrect initialization.
cc: "evalfunc.c", line 853: error 1521: Incorrect initialization.
cc: "evalfunc.c", line 863: error 1521: Incorrect initialization.
cc: "evalfunc.c", line 866: error 1521: Incorrect initialization.
cc: "evalfunc.c", line 910: error 1521: Incorrect initialization.
cc: "evalfunc.c", line 911: error 1521: Incorrect initialization.
cc: "evalfunc.c", line 926: error 1521: Incorrect initialization.
cc: "evalfunc.c", line 957: error 1521: Incorrect initialization.
cc: "evalfunc.c", line 959: error 1521: Incorrect initialization.
cc: "evalfunc.c", line 987: error 1521: Incorrect initialization.
*** Error exit code 1
Stop.
*** Error exit code 1
Stop.
</snip>
I'm not sure of the correct fix, so I have put together three different
possibilities, all of which appear to fix the problem both on HP-UX and
mingw64.
Regards
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].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/1c3dae00-776c-979b-0448-0835d5b6104b%40internode.on.net.
--- evalfunc.c.orig 2020-03-27 09:22:12.000000000 +1100
+++ evalfunc.c 2020-03-27 09:30:05.777314100 +1100
@@ -418,7 +418,9 @@
static funcentry_T global_functions[] =
{
{"abs", 1, 1, FEARG_1, ret_any, FLOAT_FUNC(f_abs)},
+#ifdef FEAT_FLOAT
{"acos", 1, 1, FEARG_1, ret_float, FLOAT_FUNC(f_acos)},
+#endif
{"add", 2, 2, FEARG_1, ret_any, f_add},
{"and", 2, 2, FEARG_1, ret_number, f_and},
{"append", 2, 2, FEARG_LAST, ret_number, f_append},
@@ -427,7 +429,9 @@
{"argidx", 0, 0, 0, ret_number, f_argidx},
{"arglistid", 0, 2, 0, ret_number, f_arglistid},
{"argv", 0, 2, 0, ret_any, f_argv},
+#ifdef FEAT_FLOAT
{"asin", 1, 1, FEARG_1, ret_float, FLOAT_FUNC(f_asin)},
+#endif
{"assert_beeps", 1, 2, FEARG_1, ret_number, f_assert_beeps},
{"assert_equal", 2, 3, FEARG_2, ret_number, f_assert_equal},
{"assert_equalfile", 2, 2, FEARG_1, ret_number,
f_assert_equalfile},
@@ -440,8 +444,10 @@
{"assert_notmatch", 2, 3, FEARG_2, ret_number,
f_assert_notmatch},
{"assert_report", 1, 1, FEARG_1, ret_number, f_assert_report},
{"assert_true", 1, 2, FEARG_1, ret_number, f_assert_true},
+#ifdef FEAT_FLOAT
{"atan", 1, 1, FEARG_1, ret_float, FLOAT_FUNC(f_atan)},
{"atan2", 2, 2, FEARG_1, ret_float, FLOAT_FUNC(f_atan2)},
+#endif
{"balloon_gettext", 0, 0, 0, ret_string,
#ifdef FEAT_BEVAL
f_balloon_gettext
@@ -481,18 +487,24 @@
{"byteidx", 2, 2, FEARG_1, ret_number, f_byteidx},
{"byteidxcomp", 2, 2, FEARG_1, ret_number, f_byteidxcomp},
{"call", 2, 3, FEARG_1, ret_any, f_call},
+#ifdef FEAT_FLOAT
{"ceil", 1, 1, FEARG_1, ret_float, FLOAT_FUNC(f_ceil)},
+#endif
{"ch_canread", 1, 1, FEARG_1, ret_number, JOB_FUNC(f_ch_canread)},
{"ch_close", 1, 1, FEARG_1, ret_void, JOB_FUNC(f_ch_close)},
{"ch_close_in", 1, 1, FEARG_1, ret_void,
JOB_FUNC(f_ch_close_in)},
{"ch_evalexpr", 2, 3, FEARG_1, ret_any,
JOB_FUNC(f_ch_evalexpr)},
{"ch_evalraw", 2, 3, FEARG_1, ret_any, JOB_FUNC(f_ch_evalraw)},
{"ch_getbufnr", 2, 2, FEARG_1, ret_number,
JOB_FUNC(f_ch_getbufnr)},
+#ifdef FEAT_JOB_CHANNEL
{"ch_getjob", 1, 1, FEARG_1, ret_job, JOB_FUNC(f_ch_getjob)},
+#endif
{"ch_info", 1, 1, FEARG_1, ret_dict_any,
JOB_FUNC(f_ch_info)},
{"ch_log", 1, 2, FEARG_1, ret_void, JOB_FUNC(f_ch_log)},
{"ch_logfile", 1, 2, FEARG_1, ret_void, JOB_FUNC(f_ch_logfile)},
+#ifdef FEAT_JOB_CHANNEL
{"ch_open", 1, 2, FEARG_1, ret_channel,
JOB_FUNC(f_ch_open)},
+#endif
{"ch_read", 1, 2, FEARG_1, ret_string,
JOB_FUNC(f_ch_read)},
{"ch_readblob", 1, 2, FEARG_1, ret_blob,
JOB_FUNC(f_ch_readblob)},
{"ch_readraw", 1, 2, FEARG_1, ret_string, JOB_FUNC(f_ch_readraw)},
@@ -512,8 +524,10 @@
{"complete_info", 0, 1, FEARG_1, ret_dict_any, f_complete_info},
{"confirm", 1, 4, FEARG_1, ret_number, f_confirm},
{"copy", 1, 1, FEARG_1, ret_any, f_copy},
+#ifdef FEAT_FLOAT
{"cos", 1, 1, FEARG_1, ret_float, FLOAT_FUNC(f_cos)},
{"cosh", 1, 1, FEARG_1, ret_float, FLOAT_FUNC(f_cosh)},
+#endif
{"count", 2, 4, FEARG_1, ret_number, f_count},
{"cscope_connection",0,3, 0, ret_number, f_cscope_connection},
{"cursor", 1, 3, FEARG_1, ret_number, f_cursor},
@@ -540,7 +554,9 @@
{"execute", 1, 2, FEARG_1, ret_string, f_execute},
{"exepath", 1, 1, FEARG_1, ret_string, f_exepath},
{"exists", 1, 1, FEARG_1, ret_number, f_exists},
+#ifdef FEAT_FLOAT
{"exp", 1, 1, FEARG_1, ret_float, FLOAT_FUNC(f_exp)},
+#endif
{"expand", 1, 3, FEARG_1, ret_any, f_expand},
{"expandcmd", 1, 1, FEARG_1, ret_string, f_expandcmd},
{"extend", 2, 3, FEARG_1, ret_any, f_extend},
@@ -552,8 +568,10 @@
{"finddir", 1, 3, FEARG_1, ret_string, f_finddir},
{"findfile", 1, 3, FEARG_1, ret_string, f_findfile},
{"float2nr", 1, 1, FEARG_1, ret_number, FLOAT_FUNC(f_float2nr)},
+#ifdef FEAT_FLOAT
{"floor", 1, 1, FEARG_1, ret_float, FLOAT_FUNC(f_floor)},
{"fmod", 2, 2, FEARG_1, ret_float, FLOAT_FUNC(f_fmod)},
+#endif
{"fnameescape", 1, 1, FEARG_1, ret_string, f_fnameescape},
{"fnamemodify", 2, 2, FEARG_1, ret_string, f_fnamemodify},
{"foldclosed", 1, 1, FEARG_1, ret_number, f_foldclosed},
@@ -639,10 +657,14 @@
{"islocked", 1, 1, FEARG_1, ret_number, f_islocked},
{"isnan", 1, 1, FEARG_1, ret_number, MATH_FUNC(f_isnan)},
{"items", 1, 1, FEARG_1, ret_list_any, f_items},
+#ifdef FEAT_JOB_CHANNEL
{"job_getchannel", 1, 1, FEARG_1, ret_channel,
JOB_FUNC(f_job_getchannel)},
+#endif
{"job_info", 0, 1, FEARG_1, ret_dict_any, JOB_FUNC(f_job_info)},
{"job_setoptions", 2, 2, FEARG_1, ret_void,
JOB_FUNC(f_job_setoptions)},
+#ifdef FEAT_JOB_CHANNEL
{"job_start", 1, 2, FEARG_1, ret_job, JOB_FUNC(f_job_start)},
+#endif
{"job_status", 1, 1, FEARG_1, ret_string, JOB_FUNC(f_job_status)},
{"job_stop", 1, 2, FEARG_1, ret_number, JOB_FUNC(f_job_stop)},
{"join", 1, 2, FEARG_1, ret_string, f_join},
@@ -663,8 +685,10 @@
{"listener_flush", 0, 1, FEARG_1, ret_void, f_listener_flush},
{"listener_remove", 1, 1, FEARG_1, ret_number,
f_listener_remove},
{"localtime", 0, 0, 0, ret_number, f_localtime},
+#ifdef FEAT_FLOAT
{"log", 1, 1, FEARG_1, ret_float, FLOAT_FUNC(f_log)},
{"log10", 1, 1, FEARG_1, ret_float, FLOAT_FUNC(f_log10)},
+#endif
{"luaeval", 1, 2, FEARG_1, ret_any,
#ifdef FEAT_LUA
f_luaeval
@@ -733,7 +757,9 @@
{"popup_setoptions", 2, 2, FEARG_1, ret_void,
PROP_FUNC(f_popup_setoptions)},
{"popup_settext", 2, 2, FEARG_1, ret_void,
PROP_FUNC(f_popup_settext)},
{"popup_show", 1, 1, FEARG_1, ret_void,
PROP_FUNC(f_popup_show)},
+#ifdef FEAT_FLOAT
{"pow", 2, 2, FEARG_1, ret_float, FLOAT_FUNC(f_pow)},
+#endif
{"prevnonblank", 1, 1, FEARG_1, ret_number, f_prevnonblank},
{"printf", 1, 19, FEARG_2, ret_string, f_printf},
{"prompt_setcallback", 2, 2, FEARG_1, ret_void,
JOB_FUNC(f_prompt_setcallback)},
@@ -779,7 +805,9 @@
{"reg_executing", 0, 0, 0, ret_string, f_reg_executing},
{"reg_recording", 0, 0, 0, ret_string, f_reg_recording},
{"reltime", 0, 2, FEARG_1, ret_list_any, f_reltime},
+#ifdef FEAT_FLOAT
{"reltimefloat", 1, 1, FEARG_1, ret_float,
FLOAT_FUNC(f_reltimefloat)},
+#endif
{"reltimestr", 1, 1, FEARG_1, ret_string, f_reltimestr},
{"remote_expr", 2, 4, FEARG_1, ret_string, f_remote_expr},
{"remote_foreground", 1, 1, FEARG_1, ret_string, f_remote_foreground},
@@ -792,7 +820,9 @@
{"repeat", 2, 2, FEARG_1, ret_any, f_repeat},
{"resolve", 1, 1, FEARG_1, ret_string, f_resolve},
{"reverse", 1, 1, FEARG_1, ret_any, f_reverse},
+#ifdef FEAT_FLOAT
{"round", 1, 1, FEARG_1, ret_float, FLOAT_FUNC(f_round)},
+#endif
{"rubyeval", 1, 1, FEARG_1, ret_any,
#ifdef FEAT_RUBY
f_rubyeval
@@ -849,8 +879,10 @@
{"sign_unplace", 1, 2, FEARG_1, ret_number,
SIGN_FUNC(f_sign_unplace)},
{"sign_unplacelist", 1, 2, FEARG_1, ret_list_number,
SIGN_FUNC(f_sign_unplacelist)},
{"simplify", 1, 1, 0, ret_string, f_simplify},
+#ifdef FEAT_FLOAT
{"sin", 1, 1, FEARG_1, ret_float, FLOAT_FUNC(f_sin)},
{"sinh", 1, 1, FEARG_1, ret_float, FLOAT_FUNC(f_sinh)},
+#endif
{"sort", 1, 3, FEARG_1, ret_list_any, f_sort},
{"sound_clear", 0, 0, 0, ret_void,
SOUND_FUNC(f_sound_clear)},
{"sound_playevent", 1, 2, FEARG_1, ret_number,
SOUND_FUNC(f_sound_playevent)},
@@ -860,10 +892,14 @@
{"spellbadword", 0, 1, FEARG_1, ret_list_string, f_spellbadword},
{"spellsuggest", 1, 3, FEARG_1, ret_list_string, f_spellsuggest},
{"split", 1, 3, FEARG_1, ret_list_string, f_split},
+#ifdef FEAT_FLOAT
{"sqrt", 1, 1, FEARG_1, ret_float, FLOAT_FUNC(f_sqrt)},
+#endif
{"srand", 0, 1, FEARG_1, ret_list_number, f_srand},
{"state", 0, 1, FEARG_1, ret_string, f_state},
+#ifdef FEAT_FLOAT
{"str2float", 1, 1, FEARG_1, ret_float,
FLOAT_FUNC(f_str2float)},
+#endif
{"str2list", 1, 2, FEARG_1, ret_list_number, f_str2list},
{"str2nr", 1, 3, FEARG_1, ret_number, f_str2nr},
{"strcharpart", 2, 3, FEARG_1, ret_string, f_strcharpart},
@@ -907,8 +943,10 @@
{"tabpagewinnr", 1, 2, FEARG_1, ret_number, f_tabpagewinnr},
{"tagfiles", 0, 0, 0, ret_list_string, f_tagfiles},
{"taglist", 1, 2, FEARG_1, ret_list_dict_any, f_taglist},
+#ifdef FEAT_FLOAT
{"tan", 1, 1, FEARG_1, ret_float, FLOAT_FUNC(f_tan)},
{"tanh", 1, 1, FEARG_1, ret_float, FLOAT_FUNC(f_tanh)},
+#endif
{"tempname", 0, 0, 0, ret_string, f_tempname},
{"term_dumpdiff", 2, 3, FEARG_1, ret_number,
TERM_FUNC(f_term_dumpdiff)},
{"term_dumpload", 1, 2, FEARG_1, ret_number,
TERM_FUNC(f_term_dumpload)},
@@ -923,7 +961,9 @@
},
{"term_getattr", 2, 2, FEARG_1, ret_number,
TERM_FUNC(f_term_getattr)},
{"term_getcursor", 1, 1, FEARG_1, ret_list_any,
TERM_FUNC(f_term_getcursor)},
+#ifdef FEAT_JOB_CHANNEL
{"term_getjob", 1, 1, FEARG_1, ret_job,
TERM_FUNC(f_term_getjob)},
+#endif
{"term_getline", 2, 2, FEARG_1, ret_string,
TERM_FUNC(f_term_getline)},
{"term_getscrolled", 1, 1, FEARG_1, ret_number,
TERM_FUNC(f_term_getscrolled)},
{"term_getsize", 1, 1, FEARG_1, ret_list_number,
TERM_FUNC(f_term_getsize)},
@@ -954,9 +994,13 @@
{"test_getvalue", 1, 1, FEARG_1, ret_number, f_test_getvalue},
{"test_ignore_error", 1, 1, FEARG_1, ret_void, f_test_ignore_error},
{"test_null_blob", 0, 0, 0, ret_blob, f_test_null_blob},
+#ifdef FEAT_JOB_CHANNEL
{"test_null_channel", 0, 0, 0, ret_channel,
JOB_FUNC(f_test_null_channel)},
+#endif
{"test_null_dict", 0, 0, 0, ret_dict_any, f_test_null_dict},
+#ifdef FEAT_JOB_CHANNEL
{"test_null_job", 0, 0, 0, ret_job,
JOB_FUNC(f_test_null_job)},
+#endif
{"test_null_list", 0, 0, 0, ret_list_any, f_test_null_list},
{"test_null_partial", 0, 0, 0, ret_partial_void,
f_test_null_partial},
{"test_null_string", 0, 0, 0, ret_string, f_test_null_string},
@@ -984,7 +1028,9 @@
{"toupper", 1, 1, FEARG_1, ret_string, f_toupper},
{"tr", 3, 3, FEARG_1, ret_string, f_tr},
{"trim", 1, 2, FEARG_1, ret_string, f_trim},
+#ifdef FEAT_FLOAT
{"trunc", 1, 1, FEARG_1, ret_float, FLOAT_FUNC(f_trunc)},
+#endif
{"type", 1, 1, FEARG_1, ret_number, f_type},
{"undofile", 1, 1, FEARG_1, ret_string, f_undofile},
{"undotree", 0, 0, 0, ret_dict_any, f_undotree},
--- evalfunc.c.orig 2020-03-27 09:22:12.000000000 +1100
+++ evalfunc.c 2020-03-27 12:05:42.417042300 +1100
@@ -280,13 +280,15 @@
{
return &t_number;
}
-#ifdef FEAT_FLOAT
static type_T *
ret_float(int argcount UNUSED, type_T **argtypes UNUSED)
{
+#ifdef FEAT_FLOAT
return &t_float;
-}
+#else
+ return &t_void;
#endif
+}
static type_T *
ret_string(int argcount UNUSED, type_T **argtypes UNUSED)
{
@@ -336,18 +338,24 @@
{
return &t_partial_void;
}
-#ifdef FEAT_JOB_CHANNEL
static type_T *
ret_channel(int argcount UNUSED, type_T **argtypes UNUSED)
{
+#ifdef FEAT_JOB_CHANNEL
return &t_channel;
+#else
+ return &t_void;
+#endif
}
static type_T *
ret_job(int argcount UNUSED, type_T **argtypes UNUSED)
{
+#ifdef FEAT_JOB_CHANNEL
return &t_job;
-}
+#else
+ return &t_void;
#endif
+}
static type_T *ret_f_function(int argcount, type_T **argtypes);
--- evalfunc.c.orig 2020-03-27 09:22:12.000000000 +1100
+++ evalfunc.c 2020-03-27 12:26:10.115126000 +1100
@@ -376,8 +376,10 @@
#ifdef FEAT_FLOAT
# define FLOAT_FUNC(name) name
+# define ret_float ret_float
#else
# define FLOAT_FUNC(name) NULL
+# define ret_float NULL
#endif
#if defined(FEAT_FLOAT) && defined(HAVE_MATH_H)
# define MATH_FUNC(name) name
@@ -391,8 +393,12 @@
#endif
#ifdef FEAT_JOB_CHANNEL
# define JOB_FUNC(name) name
+# define ret_job ret_job
+# define ret_channel ret_channel
#else
# define JOB_FUNC(name) NULL
+# define ret_job NULL
+# define ret_channel NULL
#endif
#ifdef FEAT_PROP_POPUP
# define PROP_FUNC(name) name