From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.devel Subject: Re: Suspicious warning in W64 build Date: Thu, 7 Sep 2017 12:26:06 -0700 Organization: UCLA Computer Science Department Message-ID: <102a4c21-c275-c73e-ec53-0d85975dc968@cs.ucla.edu> References: <1017454172.910810.1504618695244@mail.libero.it> <83tw0ezgi1.fsf@gnu.org> <1146932094.13821.1504798935795@mail.libero.it> <83mv66z66p.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1504812823 8279 195.159.176.226 (7 Sep 2017 19:33:43 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 7 Sep 2017 19:33:43 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 Cc: angelo.g0@libero.it, emacs-devel@gnu.org To: Eli Zaretskii , Richard Copley Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Sep 07 21:33:29 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dq2Y0-0000a9-2n for ged-emacs-devel@m.gmane.org; Thu, 07 Sep 2017 21:33:08 +0200 Original-Received: from localhost ([::1]:41938 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dq2Y7-0004SA-AW for ged-emacs-devel@m.gmane.org; Thu, 07 Sep 2017 15:33:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42670) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dq2RS-00084s-Sh for emacs-devel@gnu.org; Thu, 07 Sep 2017 15:26:27 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dq2RO-0005Ux-AY for emacs-devel@gnu.org; Thu, 07 Sep 2017 15:26:22 -0400 Original-Received: from zimbra.cs.ucla.edu ([131.179.128.68]:35150) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dq2RJ-0005Qh-7N; Thu, 07 Sep 2017 15:26:13 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 14CC51600B0; Thu, 7 Sep 2017 12:26:12 -0700 (PDT) Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id UQVqb9tzDvlz; Thu, 7 Sep 2017 12:26:06 -0700 (PDT) Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 88884160A90; Thu, 7 Sep 2017 12:26:06 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 2pAiYj9-GAQP; Thu, 7 Sep 2017 12:26:06 -0700 (PDT) Original-Received: from [192.168.1.9] (unknown [47.153.184.153]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 5D59E160A79; Thu, 7 Sep 2017 12:26:06 -0700 (PDT) In-Reply-To: <83mv66z66p.fsf@gnu.org> Content-Language: en-US X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 131.179.128.68 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:217991 Archived-At: Eli Zaretskii wrote: >> 18446744065119617024 is 1<<64. >> The other number is (1<<64) - (1<<33) - (1<<2). > Yes, I know. I just don't understand why GCC things that > > nglyphs * sizeof (WORD) * 2 > > can have a value in this range. The type of nglyphs is 'int', and > sizeof(WORD) gives 2. So the range should be between 0 (or 4) and 4 > times INT_MAX, which is nowhere near the values GCC displays. > If nglyphs is negative the first multiplication is done using unsigned arithmetic, which could result in huge results. Presumably GCC does not know that nglyphs must be nonnegative. Try putting an 'eassume (0 <= nglyphs);' before the line in question. That is, if you're sure that nglyphs is nonnegative: if you're not, GCC has found a real bug here.