On 17-Mar-2023 08:43, Bram Moolenaar wrote:
Patch 9.0.1411
Problem:    Accuracy of profiling is not optimal.
Solution:   Use CLOCK_MONOTONIC if possible. (Ernie Rael, closes #12129)
Files:      runtime/doc/builtin.txt, runtime/doc/repeat.txt, src/evalfunc.c,
             src/profiler.c, src/time.c, src/vim.h,
             src/testdir/test_profile.vim, src/testdir/test_sleep.vim


After this patch msys2-64 (clang 15.0.7) gives this warning:
<snip>
clang -c -I. -Iproto -DWIN32 -DWINVER=0x0603 -D_WIN32_WINNT=0x0603 -DHAVE_PATHDEF -DFEAT_NORMAL -DHAVE_STDINT_H -D__USE_MINGW_ANSI_STDIO -pipe -Wall -O3 -fomit-frame-pointer -fpie -fPIE -DFEAT_GUI_MSWIN -DFEAT_CLIPBOARD time.c -o gobjx86-64/time.o
time.c:261:17: warning: unused variable 'buf' [-Wunused-variable]
    static char buf[50];
                ^
1 warning generated.
</snip>

The attached patch 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/cf38b163-2465-0e6f-8be1-b5b152b02c5e%40internode.on.net.
--- time.c.orig 2023-03-18 05:21:10.269170700 +1100
+++ time.c      2023-03-18 05:26:53.749919300 +1100
@@ -258,9 +258,12 @@
     void
 f_reltimestr(typval_T *argvars UNUSED, typval_T *rettv)
 {
-    static char buf[50];
 # ifdef FEAT_RELTIME
     proftime_T tm;
+# ifdef MSWIN
+# else
+    static char buf[50];
+# endif
 # endif
 
     rettv->v_type = VAR_STRING;

Raspunde prin e-mail lui