From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Wrong pointer comparison in w32fns.c Date: Sun, 30 Oct 2022 08:24:45 +0200 Message-ID: <838rkxhlqq.fsf@gnu.org> References: Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26166"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Juanma Barranquero Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Oct 30 07:25:39 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1op1lK-0006e7-OO for ged-emacs-devel@m.gmane-mx.org; Sun, 30 Oct 2022 07:25:38 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1op1kq-00077H-Gc; Sun, 30 Oct 2022 02:25:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1op1kl-00072U-JL for emacs-devel@gnu.org; Sun, 30 Oct 2022 02:25:06 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1op1kl-0007ab-AG; Sun, 30 Oct 2022 02:25:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=nS8HtzcMuzH/fBGO0ukBcLctDWBIvlBn8X8UzGA8qUM=; b=lcKtRTzRbcML sZIfvZqHZUq1BjaaALj8twuPl3qI60xwDIZYzIbAmVwAjMwOii7eZD8quSJ5E5JsOcySwePADZgTC kwBbgW8tOWbXPehG+/OiRecI1YEoNrgJhM25V6kQnE7TEz5FvUonp+Y0gY6fMGiJMu3pDE8RNbQtO bNndWePqtFzFFVbX/P88+HJZEbXzhTXbDLw9GIjNjr3sR1C5UEZ6SMGXCrRvOQMPk5BmmI9pdQIqW jT5IZmRXE1RxDFt0ALiicP395VcWyhsjPa92/ObJC70u1X3ZgVz1U69u88nm32RdjI3731nTkuRt2 nYf1AEvsTpTwDENRMzZtWw==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1op1kk-0006ON-Pe; Sun, 30 Oct 2022 02:25:03 -0400 In-Reply-To: (message from Juanma Barranquero on Sun, 30 Oct 2022 00:36:20 +0200) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: "Emacs-devel" Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:298792 Archived-At: > From: Juanma Barranquero > 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?