On 02-Mar-2020 00:05, Bram Moolenaar wrote:
Patch 8.2.0339
Problem: Vim9: function return type may depend on arguments.
Solution: Instead of a fixed return type use a function to figure out the
return type.
Files: src/evalfunc.c, src/proto/evalfunc.pro, src/vim9compile.c,
src/evalbuffer.c, src/proto/evalbuffer.pro,
src/testdir/test_vim9_script.vim
Hi,
After this patch mingw spits out this error if FEAT_FLOAT is not defined:
<snip>
gcc -c -I. -Iproto -DWIN32 -DWINVER=0x0603 -D_WIN32_WINNT=0x0603
-DHAVE_PATHDEF -DFEAT_NORMAL -DHAVE_STDINT_H -DFEAT_GUI_MSWIN
-DFEAT_CLIPBOARD -pipe -march=native -Wall -O3 -fomit-frame-pointer
-freg-struct-return evalfunc.c -o gobjnative/evalfunc.o
evalfunc.c: In function 'ret_float':
evalfunc.c:286:13: error: 't_float' undeclared (first use in this
function); did you mean 'ret_float'?
286 | return &t_float;
| ^~~~~~~
| ret_float
evalfunc.c:286:13: note: each undeclared identifier is reported only
once for each function it appears in
At top level:
evalfunc.c:284:1: warning: 'ret_float' defined but not used
[-Wunused-function]
284 | ret_float(int argcount UNUSED, type_T **argtypes UNUSED)
| ^~~~~~~~~
make: *** [Make_cyg_ming.mak:1113: gobjnative/evalfunc.o] Error 1
</snip>
Please see the attached patch which tries to fix it.
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].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/e788a912-b9ae-7051-3d21-8f203a18c821%40internode.on.net.
--- evalfunc.c.orig 2020-03-02 05:17:45.937430400 +1100
+++ evalfunc.c 2020-03-02 05:23:06.713496900 +1100
@@ -280,11 +280,13 @@
{
return &t_number;
}
+#ifdef FEAT_FLOAT
static type_T *
ret_float(int argcount UNUSED, type_T **argtypes UNUSED)
{
return &t_float;
}
+#endif
static type_T *
ret_string(int argcount UNUSED, type_T **argtypes UNUSED)
{