John Marriott wrote:

> On 14-Jan-2023 04:37, Bram Moolenaar wrote:
> > Patch 9.0.1192
> > Problem:    No error when class function argument shadows a member.
> > Solution:   Check for shadowing.
> > Files:      src/vim9class.c, src/testdir/test_vim9_class.vim
> >
> >
> After this patch, msys64 (clang 15.0.5) 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 vim9class.c -o gobjx86-64/vim9class.o
> vim9class.c:720:39: warning: comparison between pointer and integer 
> ('int' and 'void *') [-Wpointer-integer-compare]
>                          if (STRNCMP(uf->uf_name, "new", 3) == NULL && 
> il == 2)
>                              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~
> 1 warning generated.
> </snip>
> 
> The attached patch tries to fix it. I hope I have the logic the right 
> way around.

Yeah, the value of NULL is zero.  I didn't spot the warning when
compiling locally.  Patch 9.0.1194 has the same fix.

-- 
hundred-and-one symptoms of being an internet addict:
3. Your bookmark takes 15 minutes to scroll from top to bottom.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///                                                                      \\\
\\\        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
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/20230113193042.4A3DB1C0916%40moolenaar.net.

Raspunde prin e-mail lui