From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Po Lu Newsgroups: gmane.emacs.devel Subject: Re: Wrong pointer comparison in w32fns.c Date: Sun, 30 Oct 2022 08:57:17 +0800 Message-ID: <87eduqjfgy.fsf@yahoo.com> References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28482"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Emacs developers To: Juanma Barranquero Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Oct 30 02:57:56 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 1ooweC-0007Dj-2T for ged-emacs-devel@m.gmane-mx.org; Sun, 30 Oct 2022 02:57:56 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oowdp-0003By-CB; Sat, 29 Oct 2022 20:57:33 -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 1oowdn-0003Bp-WA for emacs-devel@gnu.org; Sat, 29 Oct 2022 20:57:32 -0400 Original-Received: from sonic314-21.consmr.mail.ne1.yahoo.com ([66.163.189.147]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oowdm-00065T-GT for emacs-devel@gnu.org; Sat, 29 Oct 2022 20:57:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1667091447; bh=zPDLblUq3GYwNffhVr1LMd4EHKtcwOU0rlbmHV9zRl0=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From:Subject:Reply-To; b=JQyBJPCH9RU7tIwaCMxH864zhENUSx3iCaX5SGwwTWjcSmcL1MjookmKHgRxEcAEtBYZYju3WRqcEOYBIgxvQhhAh4PujhfBVx6VLNbVhf5HCijpBBg1/Dey/Le5jm7oxvC2rpB+vpFC27uLwRNI4PGo/mBMAz4gRb5QQfUfmgvwAncbsLCMEZP02lsjbAjquirY1plHq+/zPhAGH4bF8hIkxofen7nDgsoIZY0aOfyerLm8xevuEE9FqxrGAQggqy1hYL7MhlezroNv9wBBxcHsDXjvK2FP6qo6X9nfzsHRfLel6ZG6S1RWjgLNMAsuILaZoWYqWv9kTVuO/SYrTw== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1667091447; bh=h2aCmyRsJUe8Sa+IGHKDiLYTeK6wVmBPJ4PC8xu+IlF=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=P8HzSXtdPN/dfT25eRym4ckFd4WWoKbkoA9NRGfGlmqnoyTOIJk6f/vaY2FTDOz/CiNscy+uBlno0fH1oeZYDSNVK1emBQwv1jtYRHRSDiQf6riz4FXxeH+Yhn5vN+v1HDR+OCIEGxoGYo8vcOWY2Cmhc4K+P5ZIK2fBEnX3x6tfEZ7C+dXVFpZKnDMrw5782Up67DCxOEeJppjm9WlttkSvn34puU+Oe7XuVwLFf1Ti+0fLmghM89+MIJOIUq25LoQPRANF+uBYvqpdf11jW/yl7JfSaoQXSkEMEuaLvH+FPuDShd1+qvQyxPOQZmd6QOqnDQVrYrQG9zE7DoZx5g== X-YMail-OSG: 05eVwHwVM1nI_Vej6XCqmWHrCws8tqNzMh1r4Sgu_aQOd.xAn7WwQU4lj_Np.Zx iE3Sh1MTecN5cHW6PIkIBUx1nDsrLOy3stZ8I63WQTyVp4B3WIAwIFX3Sa52LBSUOufg2gFz_vKM Gj2f20JGMmSgI_qowb25dt4Ojl0LOaMLWeIhQTaVCc1GhE20g4y.smxBip.qvZ9iKTLFIvC0RBq5 cMC3diLJPke104cB8HOHUNQZpO2Y.r8mkoA.mKE_qqJ8rkTlo7gZi6B5LcBzYoT.GRhbEUXoTqX. eJqSS30HO56LkwbZBGQ15s4x4eQbhCi1J3qLmeD3m_Pqf8yVhWX84Fhy56iU9QLjoRjUNKlmrRnc KpRAu2xrnJxBg7q51MvJEw.r6zhUM2.iHIV8VweUxWv_zBv5CW_ahz4p8RLXEzOxYek4I7UCjAeg kxx.DuVMMKfJHS_UT_j1EwsE.br5MUFk2VS3JI8IX6LyBVYFpUHED.Lo956MUB7G3wG0PpEjPuoY tqakemqrwjwXwjPGwEs9cxcfyDYhISs_XbzV7FZ2JCLpXaPGTc0Rlc6G6RJvfHj9ippEOcJzOiSn 81B61KcKMqxk2bMRL9VaoZAOgGY7JXqYZH2.g6xWTwGzFTIGzlgh07t7FYGWN9n2YhCCCfDcPG4b Z6WwIzm7J8N3fouBXm21SzYK525hrw3QTfiHE6cD0NaUvupnMi.4ifAErDV1onUleDMaPBzeoFag .RnofrTH3tJQb1znc3ngccH5xl6Cmf7_8ka5VS7eoWo46OpCdoiCzkz2bBdQsXd5JQBe8L93mnIO 8AzXcnGk1OO0OyxicfToeZdmf.8jRSKuB7CaINl20. X-Sonic-MF: Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic314.consmr.mail.ne1.yahoo.com with HTTP; Sun, 30 Oct 2022 00:57:27 +0000 Original-Received: by hermes--production-sg3-74fb94585-btmps (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 0ef4f452f830763b9557bdf727f0c099; Sun, 30 Oct 2022 00:57:21 +0000 (UTC) In-Reply-To: (Juanma Barranquero's message of "Sun, 30 Oct 2022 00:36:20 +0200") X-Mailer: WebService/1.1.20783 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Received-SPF: pass client-ip=66.163.189.147; envelope-from=luangruo@yahoo.com; helo=sonic314-21.consmr.mail.ne1.yahoo.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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@gnu.org Xref: news.gmane.io gmane.emacs.devel:298787 Archived-At: Juanma Barranquero writes: > 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]; > | ^~~~~~~~ > > requiring something like this: > > diff --git i/src/w32fns.c w/src/w32fns.c > index 5f652ae9e4..46c73f762a 100644 > --- i/src/w32fns.c > +++ w/src/w32fns.c > @@ -2734,8 +2734,7 @@ setup_w32_kbdhook (void) > int i; > > CoCreateGuid (&guid); > - StringFromGUID2 (&guid, newTitle, 64); > - if (newTitle != NULL) > + if (StringFromGUID2 (&guid, newTitle, 64) && newTitle[0]) Does this function support Windows 9x? http://winapi.freetechsecrets.com/ole/OLEStringFromGUID2.htm says nothing about that.