unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Juanma Barranquero <lekktu@gmail.com>
Cc: emacs-devel@gnu.org
Subject: Re: Wrong pointer comparison in w32fns.c
Date: Sun, 30 Oct 2022 08:24:45 +0200	[thread overview]
Message-ID: <838rkxhlqq.fsf@gnu.org> (raw)
In-Reply-To: <CAAeL0STrMMp-g4HhuRy020QJf5T6uAZOnMMHfMfMsG9YfxQ8aA@mail.gmail.com> (message from Juanma Barranquero on Sun, 30 Oct 2022 00:36:20 +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?



  parent reply	other threads:[~2022-10-30  6:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-29 22:36 Wrong pointer comparison in w32fns.c Juanma Barranquero
2022-10-30  0:57 ` Po Lu
2022-10-30  6:47   ` Eli Zaretskii
2022-10-30  6:24 ` Eli Zaretskii [this message]
2022-10-30 12:13   ` Juanma Barranquero
2022-10-30 12:47     ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=838rkxhlqq.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=lekktu@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).