emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Wrong pointer comparison in w32fns.c


From: Eli Zaretskii
Subject: Re: Wrong pointer comparison in w32fns.c
Date: Sun, 30 Oct 2022 08:24:45 +0200

> From: Juanma Barranquero <lekktu@gmail.com>
> Date: Sun, 30 Oct 2022 00:36:20 +0200
> 
> Presumably, this is a bug in rarely used code (affecting NT 4 systems):
> 
>   CC       w32fns.o
> w32fns.c: In function 'setup_w32_kbdhook':
> w32fns.c:2738:24: warning: the comparison will always evaluate as 'true' for 
> the address of 'newTitle' will
> never be NULL [-Waddress]
>  2738 |           if (newTitle != NULL)
>       |                        ^~
> w32fns.c:2733:19: note: 'newTitle' declared here
>  2733 |           wchar_t newTitle[64];
>       |                   ^~~~~~~~
> 

Isn't it simply a typo?  The intent was to test oldTitle, which is
dynamically allocated by malloc.  Right?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]