From unknown Mon Aug 18 14:20:56 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#17681 <17681@debbugs.gnu.org> To: bug#17681 <17681@debbugs.gnu.org> Subject: Status: 24.3.91; "Arithmetic Error" in hide-ifdef mode when using shift operators Reply-To: bug#17681 <17681@debbugs.gnu.org> Date: Mon, 18 Aug 2025 21:20:56 +0000 retitle 17681 24.3.91; "Arithmetic Error" in hide-ifdef mode when using shi= ft operators reassign 17681 emacs submitter 17681 David Engster severity 17681 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Tue Jun 03 15:13:13 2014 Received: (at submit) by debbugs.gnu.org; 3 Jun 2014 19:13:13 +0000 Received: from localhost ([127.0.0.1]:42612 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Wru92-0007nN-O5 for submit@debbugs.gnu.org; Tue, 03 Jun 2014 15:13:13 -0400 Received: from eggs.gnu.org ([208.118.235.92]:53832) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Wru8z-0007mv-P3 for submit@debbugs.gnu.org; Tue, 03 Jun 2014 15:13:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wru8n-0006ow-PO for submit@debbugs.gnu.org; Tue, 03 Jun 2014 15:13:04 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:36119) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wru8n-0006os-Ma for submit@debbugs.gnu.org; Tue, 03 Jun 2014 15:12:57 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55518) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wru8h-0005aH-KL for bug-gnu-emacs@gnu.org; Tue, 03 Jun 2014 15:12:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wru8b-0006my-HW for bug-gnu-emacs@gnu.org; Tue, 03 Jun 2014 15:12:51 -0400 Received: from randomsample.de ([5.45.97.173]:54648) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wru8b-0006lZ-8B for bug-gnu-emacs@gnu.org; Tue, 03 Jun 2014 15:12:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=randomsample.de; s=a; h=Content-Type:MIME-Version:Message-ID:Date:Subject:To:From; bh=2taozh2pmn14WA5n/Ag6TeCyobYu60ao9hWmaPFF8k0=; b=jlDxnQi/pdZY62e5ezwVn8JFqFCCFRF3lG8ChtQrJFp5VHygbgyfJ0kuiTPvn52wkNBny27s7/pJl+Z2/IGgeBWUUu00yyFdByjRgOrjbNHJyAayzyShshsD7YlX0oQF; Received: from dslc-082-083-039-000.pools.arcor-ip.net ([82.83.39.0] helo=spaten) by randomsample.de with esmtpsa (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1Wru8U-0002wx-85 for bug-gnu-emacs@gnu.org; Tue, 03 Jun 2014 21:12:38 +0200 From: David Engster To: bug-gnu-emacs@gnu.org Subject: 24.3.91; "Arithmetic Error" in hide-ifdef mode when using shift operators Date: Tue, 03 Jun 2014 21:12:33 +0200 Message-ID: <87zjhtn6xq.fsf@engster.org> MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.9 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) Recipe: - Create a file "test.h" containing the following (this is from the file 'jiffies.h' in the Linux kernel): #if !((((NSEC_PER_SEC << 2) / TICK_NSEC) << (SEC_JIFFIE_SC - 2)) & 0x80000000) #endif - emacs -Q - Load the file, activate hide-ifdef-mode - C-c @ h (hide-ifdefs) The minibuffer will show "Arithmetic Error". Here is the backtrace: Debugger entered--Lisp error: (arith-error) hif-divide(0 nil) (hif-shiftleft (hif-divide (hif-shiftleft (hif-lookup (quote NSEC_PER_SEC)) 2) (hif-lookup (quote TICK_NSEC))) (hif-minus (hif-lookup (quote SEC_JIFFIE_SC)) 2)) (hif-logand (hif-shiftleft (hif-divide (hif-shiftleft (hif-lookup (quote NSEC_PER_SEC)) 2) (hif-lookup (quote TICK_NSEC))) (hif-minus (hif-lookup (quote SEC_JIFFIE_SC)) 2)) 2147483648.0) (hif-not (hif-logand (hif-shiftleft (hif-divide (hif-shiftleft (hif-lookup (quote NSEC_PER_SEC)) 2) (hif-lookup (quote TICK_NSEC))) (hif-minus (hif-lookup (quote SEC_JIFFIE_SC)) 2)) 2147483648.0)) eval((hif-not (hif-logand (hif-shiftleft (hif-divide (hif-shiftleft (hif-lookup (quote NSEC_PER_SEC)) 2) (hif-lookup (quote TICK_NSEC))) (hif-minus (hif-lookup (quote SEC_JIFFIE_SC)) 2)) 2147483648.0))) hif-possibly-hide() hide-ifdef-guts() hide-ifdefs() Earlier Emacsen did not throw an error here (although it is very possible that the above line wasn't calculated correctly). Still, this probably qualifies as a regression. -David From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 05 18:26:19 2014 Received: (at 17681) by debbugs.gnu.org; 5 Jun 2014 22:26:19 +0000 Received: from localhost ([127.0.0.1]:46221 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Wsg71-00085I-4O for submit@debbugs.gnu.org; Thu, 05 Jun 2014 18:26:19 -0400 Received: from fencepost.gnu.org ([208.118.235.10]:36317 ident=Debian-exim) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Wsg6y-000858-Gc for 17681@debbugs.gnu.org; Thu, 05 Jun 2014 18:26:17 -0400 Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1Wsg6x-0006AJ-BR; Thu, 05 Jun 2014 18:26:15 -0400 From: Glenn Morris To: luke.yx.lee@gmail.com Subject: Re: bug#17681: 24.3.91; "Arithmetic Error" in hide-ifdef mode when using shift operators References: <87zjhtn6xq.fsf@engster.org> X-Spook: Aladdin Mossad electronic surveillance Venezuela Verisign X-Ran: (yj##[>ya2v?0B)SR<-XVY.];No@,3eE5T~RAJ`>v0Zg2y`0"8qWua*Slg3.J=I!3L$8&Q X-Hue: magenta X-Attribution: GM Date: Thu, 05 Jun 2014 18:26:15 -0400 In-Reply-To: <87zjhtn6xq.fsf@engster.org> (David Engster's message of "Tue, 03 Jun 2014 21:12:33 +0200") Message-ID: User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -5.7 (-----) X-Debbugs-Envelope-To: 17681 Cc: 17681@debbugs.gnu.org, David Engster X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.7 (-----) Luke, could you take a look at this report please? http://debbugs.gnu.org/17681 An artificial but smaller example might be: #if 1 / FOO #endif David Engster wrote: > Recipe: > > - Create a file "test.h" containing the following (this is from > the file 'jiffies.h' in the Linux kernel): > > #if !((((NSEC_PER_SEC << 2) / TICK_NSEC) << (SEC_JIFFIE_SC - 2)) & 0x80000000) > #endif > > - emacs -Q > > - Load the file, activate hide-ifdef-mode > > - C-c @ h (hide-ifdefs) > > The minibuffer will show "Arithmetic Error". Here is the backtrace: > > Debugger entered--Lisp error: (arith-error) > hif-divide(0 nil) > (hif-shiftleft (hif-divide (hif-shiftleft (hif-lookup (quote NSEC_PER_SEC)) 2) (hif-lookup (quote TICK_NSEC))) (hif-minus (hif-lookup (quote SEC_JIFFIE_SC)) 2)) > (hif-logand (hif-shiftleft (hif-divide (hif-shiftleft (hif-lookup (quote NSEC_PER_SEC)) 2) (hif-lookup (quote TICK_NSEC))) (hif-minus (hif-lookup (quote SEC_JIFFIE_SC)) 2)) 2147483648.0) > (hif-not (hif-logand (hif-shiftleft (hif-divide (hif-shiftleft (hif-lookup (quote NSEC_PER_SEC)) 2) (hif-lookup (quote TICK_NSEC))) (hif-minus (hif-lookup (quote SEC_JIFFIE_SC)) 2)) 2147483648.0)) > eval((hif-not (hif-logand (hif-shiftleft (hif-divide (hif-shiftleft (hif-lookup (quote NSEC_PER_SEC)) 2) (hif-lookup (quote TICK_NSEC))) (hif-minus (hif-lookup (quote SEC_JIFFIE_SC)) 2)) 2147483648.0))) > hif-possibly-hide() > hide-ifdef-guts() > hide-ifdefs() > > Earlier Emacsen did not throw an error here (although it is very > possible that the above line wasn't calculated correctly). Still, this > probably qualifies as a regression. From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 05 21:04:44 2014 Received: (at 17681) by debbugs.gnu.org; 6 Jun 2014 01:04:44 +0000 Received: from localhost ([127.0.0.1]:46291 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WsiaJ-00054f-7U for submit@debbugs.gnu.org; Thu, 05 Jun 2014 21:04:43 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:40514) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WsiaG-00054K-T3 for 17681@debbugs.gnu.org; Thu, 05 Jun 2014 21:04:41 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AkgRAIDvNVPO+IOj/2dsb2JhbABZgwYYI4MPwD2BFxd0giUBAQEBAgFWIwULCw4mEhQYDSSIBAjSGReOegeEOASaAYs7g12BaoFxgVsh X-IPAS-Result: AkgRAIDvNVPO+IOj/2dsb2JhbABZgwYYI4MPwD2BFxd0giUBAQEBAgFWIwULCw4mEhQYDSSIBAjSGReOegeEOASaAYs7g12BaoFxgVsh X-IronPort-AV: E=Sophos;i="4.97,753,1389762000"; d="scan'208";a="65991776" Received: from 206-248-131-163.dsl.teksavvy.com (HELO pastel.home) ([206.248.131.163]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 05 Jun 2014 21:04:34 -0400 Received: by pastel.home (Postfix, from userid 20848) id 7310660705; Thu, 5 Jun 2014 21:04:34 -0400 (EDT) From: Stefan Monnier To: Glenn Morris Subject: Re: bug#17681: 24.3.91; "Arithmetic Error" in hide-ifdef mode when using shift operators Message-ID: References: <87zjhtn6xq.fsf@engster.org> Date: Thu, 05 Jun 2014 21:04:34 -0400 In-Reply-To: (Glenn Morris's message of "Thu, 05 Jun 2014 18:26:15 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 17681 Cc: 17681@debbugs.gnu.org, luke.yx.lee@gmail.com, David Engster X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) > Luke, could you take a look at this report please? > http://debbugs.gnu.org/17681 > An artificial but smaller example might be: > #if 1 / FOO > #endif I think he already sent me a patch fixing this problem (which IIUC is a problem I introduced, BTW). Stefan From debbugs-submit-bounces@debbugs.gnu.org Fri Jun 06 02:09:18 2014 Received: (at 17681) by debbugs.gnu.org; 6 Jun 2014 06:09:18 +0000 Received: from localhost ([127.0.0.1]:46400 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WsnL2-0008Io-CV for submit@debbugs.gnu.org; Fri, 06 Jun 2014 02:09:17 -0400 Received: from mail-pb0-f54.google.com ([209.85.160.54]:46611) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WsnD8-00081w-B8 for 17681@debbugs.gnu.org; Fri, 06 Jun 2014 02:01:08 -0400 Received: by mail-pb0-f54.google.com with SMTP id jt11so2194580pbb.41 for <17681@debbugs.gnu.org>; Thu, 05 Jun 2014 23:00:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=eKQAoRdP0YQY2y5WayxaUG4Zxd13NFwza4/l6PbUsEQ=; b=rutA+K/BysFejIZHN5WDs4uJxTgIkzIIVV+rXKuwTXW1I3bFZKBF3xzpxr/qf5+3Ad oreZSoSrzBW9NzmEBb1PAwkpqql33kdFLmRXROfCE139Q/OaPZmJSJwbURw3UwHiy4KH wP8OaiYgeKPh8cn+fn+eE6wdReOGDvr9ZH3pQXmVloYq5mQjWLtI6jDNAuNZHftmxxBf S76a8tDM4ydhICBHteAkN5tEY6IlAoSrzTTUokAS2eNWe+0nyLT80z2lRzj3RK+39sP4 25Yaqpvxx40LXWorbUmRwrFH+c/y/x9o/rsnePjBwswDtP+VjxgJQMyBJ/bco/SC2NVQ 8v5Q== X-Received: by 10.68.222.196 with SMTP id qo4mr5332111pbc.14.1402034459537; Thu, 05 Jun 2014 23:00:59 -0700 (PDT) MIME-Version: 1.0 Received: by 10.70.89.228 with HTTP; Thu, 5 Jun 2014 23:00:19 -0700 (PDT) In-Reply-To: References: <87zjhtn6xq.fsf@engster.org> From: Luke Lee Date: Fri, 6 Jun 2014 14:00:19 +0800 Message-ID: Subject: Re: bug#17681: 24.3.91; "Arithmetic Error" in hide-ifdef mode when using shift operators To: Stefan Monnier Content-Type: multipart/alternative; boundary=047d7b2ede71ec77eb04fb249528 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 17681 X-Mailman-Approved-At: Fri, 06 Jun 2014 02:09:15 -0400 Cc: Glenn Morris , 17681@debbugs.gnu.org, David Engster X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) --047d7b2ede71ec77eb04fb249528 Content-Type: text/plain; charset=UTF-8 >I think he already sent me a patch fixing this problem Yes, I think my new patch fixed that problem. However, if you're trying to hide jiffies.h it will eventually failed at some other place due to the "unsigned long" integer postfix (i.e. the "UL" in 100000UL), which hideif still consider it a "TODO". #define TICK_USEC ((1000000UL + USER_HZ/2) / USER_HZ) 2014-06-06 9:04 GMT+08:00 Stefan Monnier : > > Luke, could you take a look at this report please? > > > http://debbugs.gnu.org/17681 > > > An artificial but smaller example might be: > > > #if 1 / FOO > > #endif > > I think he already sent me a patch fixing this problem (which IIUC is > a problem I introduced, BTW). > > > Stefan > -- Best regards, Luke Lee --047d7b2ede71ec77eb04fb249528 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
>I think he already sent me a patch fixing th= is problem

Yes, I think my new patch fixed that problem. However, if= you're trying to hide
jiffies.h it will eventually failed at = some other place due to the "unsigned long"
integer postfix (i.e. the "UL" in 100000UL), which hideif still c= onsider it a "TODO".

#define TICK_USEC ((1000000UL + USER_= HZ/2) / USER_HZ)



2014-06-06 9:04 GMT+08:00 Stefan Monnier <monnier@iro.umontreal.ca<= /a>>:
> Luke, could you take a look at this report please?

>
http://debb= ugs.gnu.org/17681

> An artificial but smaller example might be:

> #if 1 / FOO
> #endif

I think he already sent me a patch fixing this problem (which IIUC is=
a problem I introduced, BTW).


=C2=A0 =C2=A0 =C2=A0 =C2=A0 Stefan



--
Best rega= rds,
Luke Lee

--047d7b2ede71ec77eb04fb249528-- From debbugs-submit-bounces@debbugs.gnu.org Fri Jun 06 03:17:14 2014 Received: (at 17681) by debbugs.gnu.org; 6 Jun 2014 07:17:14 +0000 Received: from localhost ([127.0.0.1]:46453 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WsoOn-0003cQ-Ra for submit@debbugs.gnu.org; Fri, 06 Jun 2014 03:17:14 -0400 Received: from fencepost.gnu.org ([208.118.235.10]:43567 ident=Debian-exim) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WsoOl-0003cE-Jt for 17681@debbugs.gnu.org; Fri, 06 Jun 2014 03:17:12 -0400 Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1WsoOk-0003nI-4D; Fri, 06 Jun 2014 03:17:10 -0400 From: Glenn Morris To: Luke Lee Subject: Re: bug#17681: 24.3.91; "Arithmetic Error" in hide-ifdef mode when using shift operators References: <87zjhtn6xq.fsf@engster.org> X-Spook: Etacs Hugo Chavez Juiliett Class Submarine Guantanamo X-Ran: hNq~QIOXQM-?SoS5mubX'0v5_tn)(7>u1kb)E@"e7MnHNQ-w51*aSkW6.s:szUmE4zol_w X-Hue: blue X-Debbugs-No-Ack: yes X-Attribution: GM Date: Fri, 06 Jun 2014 03:17:09 -0400 Message-ID: User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -5.7 (-----) X-Debbugs-Envelope-To: 17681 Cc: 17681@debbugs.gnu.org, Stefan Monnier , David Engster X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.7 (-----) Luke Lee wrote: >>I think he already sent me a patch fixing this problem > > Yes, I think my new patch fixed that problem. Is this patch posted anywhere? > However, if you're trying to hide jiffies.h it will eventually failed > at some other place due to the "unsigned long" integer postfix (i.e. > the "UL" in 100000UL), which hideif still consider it a "TODO". > > #define TICK_USEC ((1000000UL + USER_HZ/2) / USER_HZ) When you say fail, do you mean it will give an error? If so, why not ignore-errors around these evaluations? From debbugs-submit-bounces@debbugs.gnu.org Fri Jun 06 07:11:57 2014 Received: (at 17681) by debbugs.gnu.org; 6 Jun 2014 11:11:57 +0000 Received: from localhost ([127.0.0.1]:46587 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Wss3w-0004LJ-IL for submit@debbugs.gnu.org; Fri, 06 Jun 2014 07:11:57 -0400 Received: from mail-ie0-f175.google.com ([209.85.223.175]:45527) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Wss3u-0004L1-Ba for 17681@debbugs.gnu.org; Fri, 06 Jun 2014 07:11:55 -0400 Received: by mail-ie0-f175.google.com with SMTP id tp5so665405ieb.20 for <17681@debbugs.gnu.org>; Fri, 06 Jun 2014 04:11:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=iP0dG3eLhCH6dijoUchuL0FT204msn5huN9izpArnj8=; b=slgF/9KzUQYlnUMWUqdIeX4jYnPknz7rUdl+E8keyHmq1YWBV6l2VyPrdJDucfPASu iBEqnUta+asm/iQbwt0H46p37N4yHazByKI+yPZMNbrQLoK0IeUkkHu7rcBeFroDjJYw AIPqFNyI3JTAGXkDaoJ/gu/QKryFmMvOZLwnm0By+zUF6Vavzxr474s16ojCvRLRuoGT 4alIhSt8goJESm4W/3xteCUl9VduIbOKRCEiOkwvkdl5Ce9mCPgXSzy/ymD6rvj+awES cKp55InE2wk9IiDbx/znnMt5qRVAjNgPcpnPOHSGgmpZhJjfIUW88L2WUHQfdITblgU2 VScA== X-Received: by 10.42.27.147 with SMTP id j19mr4833842icc.81.1402053108508; Fri, 06 Jun 2014 04:11:48 -0700 (PDT) MIME-Version: 1.0 Received: by 10.70.89.228 with HTTP; Fri, 6 Jun 2014 04:11:08 -0700 (PDT) In-Reply-To: References: <87zjhtn6xq.fsf@engster.org> From: Luke Lee Date: Fri, 6 Jun 2014 19:11:08 +0800 Message-ID: Subject: Re: bug#17681: 24.3.91; "Arithmetic Error" in hide-ifdef mode when using shift operators To: Glenn Morris Content-Type: multipart/alternative; boundary=20cf304352ce7d2d4104fb28edc2 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 17681 Cc: 17681@debbugs.gnu.org, Stefan Monnier , David Engster X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) --20cf304352ce7d2d4104fb28edc2 Content-Type: text/plain; charset=UTF-8 >Is this patch posted anywhere? I only send it to Stefan for review since it's a set of patches that forms the complete work of http://www.emacswiki.org/emacs/hideif.el. Patch set #1 has already been submitted into Emacs trunk while patch set #2 is still under Stefan's reviewing. Patchset #3 to come. All 3 patches forms the hideif.el posted on EmacsWiki. You can try this version. >When you say fail, do you mean it will give an error? >If so, why not ignore-errors around these evaluations? Different versions of Emacs seems to behave differently. On my Linux machine it's Emacs 24.3.50.2 and it does not throw any error. On Cygwin Emacs 24.3.2 it throw an error. It seems that others' submitted `hif-string-to-number' introduced some difference. On Cygwin's Emacs version the `split-string' function used in `hif-string-to-number' take no more than 3 arguments but it takes 4 arguments in my Linux Emacs 24.3.50.2. After fixing this they still behave differently. I'm focusing on Linux version so I did not investigate what makes the difference. Due to the internal behavior of hideif sometimes it's not so easy to just ignore some errors then continue. There are still some cases that hideif will throw an error. To prevent hideif from throwing any errors, it's actually another TODO item. I'll first complete the reviewing of the remaining patch set. 2014-06-06 15:17 GMT+08:00 Glenn Morris : > Luke Lee wrote: > > >>I think he already sent me a patch fixing this problem > > > > Yes, I think my new patch fixed that problem. > > Is this patch posted anywhere? > > > However, if you're trying to hide jiffies.h it will eventually failed > > at some other place due to the "unsigned long" integer postfix (i.e. > > the "UL" in 100000UL), which hideif still consider it a "TODO". > > > > #define TICK_USEC ((1000000UL + USER_HZ/2) / USER_HZ) > > When you say fail, do you mean it will give an error? > If so, why not ignore-errors around these evaluations? > -- Best regards, Luke Lee --20cf304352ce7d2d4104fb28edc2 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
>Is this patch posted anywhere?

<= /div>I only send it to Stefan for review since it's a set of patches that forms the complete work of

http://www.emacswiki.org/emacs/hideif.el.

Patch set #1 has already been submitted into Emacs trunk
while= patch set #2 is still under Stefan's reviewing. Patchset
#3 to come. All 3 patches forms the hideif.el posted on
EmacsWiki. You can try this version.

>When you say fai= l, do you mean it will give an error?
>If so, why not ignore-errors a= round these evaluations?

Different versions of Emacs seem= s to behave=C2=A0
differently. On my Linux machine it's Emacs 24.3.50.2
and it does n= ot throw any error. On Cygwin Emacs
24.3.2 it throw an error. It seems = that others' submitted
`hif-string-to-number' introdu= ced some difference.

On Cygwin's Emacs version the `split-string' function
used = in `hif-string-to-number' take no more than 3
arguments but it takes= 4 arguments in my Linux
Emacs 24.3.50.2. After fixing this = they still behave
differently. I'm focusing on Linux version so I did
not investigate what makes the difference.

Due to = the internal behavior of hideif sometimes it's
not so ea= sy to just ignore some errors then continue.
There are still some cases that hideif will throw an
error. = To prevent hideif from throwing any errors, it's
actually another T= ODO item. I'll first complete the
reviewing of the remaining patch s= et.



2014-06-06 15:17 GMT+08:00 Glenn Morris= <rgm= @gnu.org>:
Luke Lee wrote:

>>I think he already sent me a patch fixing this problem
>
> Yes, I think my new patch fixed that problem.

Is this patch posted anywhere?

> However, if you're trying to hide jiffies.h it will eventually fai= led
> at some other place due to the "unsigned long" integer postf= ix (i.e.
> the "UL" in 100000UL), which hideif still consider it a &quo= t;TODO".
>
> #define TICK_USEC ((1000000UL + USER_HZ/2) / USER_HZ)

When you say fail, do you mean it will give an error?
If so, why not ignore-errors around these evaluations?



--
Best regards,
Luke = Lee

--20cf304352ce7d2d4104fb28edc2-- From debbugs-submit-bounces@debbugs.gnu.org Fri Jun 06 11:20:02 2014 Received: (at 17681) by debbugs.gnu.org; 6 Jun 2014 15:20:02 +0000 Received: from localhost ([127.0.0.1]:47389 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Wsvw1-0005ou-8B for submit@debbugs.gnu.org; Fri, 06 Jun 2014 11:20:01 -0400 Received: from fencepost.gnu.org ([208.118.235.10]:34777 ident=Debian-exim) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Wsvvy-0005oi-K6 for 17681@debbugs.gnu.org; Fri, 06 Jun 2014 11:19:59 -0400 Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1Wsvvv-0006z7-Pl; Fri, 06 Jun 2014 11:19:56 -0400 From: Glenn Morris To: Luke Lee Subject: Re: bug#17681: 24.3.91; "Arithmetic Error" in hide-ifdef mode when using shift operators References: <87zjhtn6xq.fsf@engster.org> X-Spook: clandestine digicash Adriatic defense information warfare X-Ran: 24E;^|]gGI{;e`e**4]D.eDrHKpSZ'S9M-yHqr["$H4K//aAs;|vq'PRTGuVEh.6Vo6DQV X-Hue: magenta X-Debbugs-No-Ack: yes X-Attribution: GM Date: Fri, 06 Jun 2014 11:19:54 -0400 In-Reply-To: (Luke Lee's message of "Fri, 6 Jun 2014 19:11:08 +0800") Message-ID: <7wsinirrol.fsf@fencepost.gnu.org> User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -5.7 (-----) X-Debbugs-Envelope-To: 17681 Cc: 17681@debbugs.gnu.org, Stefan Monnier , David Engster X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.7 (-----) Luke Lee wrote: > Different versions of Emacs seems to behave differently. On my Linux > machine it's Emacs 24.3.50.2 and it does not throw any error. On > Cygwin Emacs 24.3.2 it throw an error. The relevant version at the moment is the Emacs 24.3.91 pretest. http://alpha.gnu.org/gnu/emacs/pretest/emacs-24.3.91.tar.xz 24.3.50 is an old development version and should not be used any more. > It seems that others' submitted `hif-string-to-number' introduced some > difference. Apart from your 2014-01-28 changes, I see no changes to hideif.el in Emacs 24.3.91 since 2012-10-02. hif-string-to-number is only in the Emacs trunk, not the emacs-24 branch, so doesn't affect this report. From debbugs-submit-bounces@debbugs.gnu.org Sun Jun 26 00:53:46 2016 Received: (at 17681-done) by debbugs.gnu.org; 26 Jun 2016 04:53:46 +0000 Received: from localhost ([127.0.0.1]:55952 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bH24o-0002ee-FL for submit@debbugs.gnu.org; Sun, 26 Jun 2016 00:53:46 -0400 Received: from mail-oi0-f45.google.com ([209.85.218.45]:32958) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bH24n-0002eR-3U for 17681-done@debbugs.gnu.org; Sun, 26 Jun 2016 00:53:45 -0400 Received: by mail-oi0-f45.google.com with SMTP id u201so163535644oie.0 for <17681-done@debbugs.gnu.org>; Sat, 25 Jun 2016 21:53:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:from:date:message-id:subject:to; bh=jiTtUvo4ydumcZGQHMxrNTUGNlrUbpZGG/xdeyLKMPY=; b=hJXPt0iGRVGTTN/m4Vbb04WbsOQHccPe94c9h85MYnYGzBEZKX01PFukMF8PcguUC5 l/jH5qZk7VveQmnDm0jDBgEdfqixFn2YkAc7ZNW6AkIRd5SQ3xzK2qNTUb1TjbXw1dVg XnTMYvi/pM5rYJtLLUt/k1C4oY6DkReNCRVw1xT9YdI4c/Vtl3hyNR6eyrjS5L4o5JDX 6VoFCF7cRtONwPtnSYOVxwV7s+FFpaEMdOxzf8cCVR8o/Xv+c1Q9hJ3Z8x8R/X0H8pP8 +IrgnumG+X1PyCXF/HCPGAxsFEenFmM9LG6YoS4DNsy8IBfy/IcC/ThISzYMW0bCiZhM +mqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:from:date:message-id:subject :to; bh=jiTtUvo4ydumcZGQHMxrNTUGNlrUbpZGG/xdeyLKMPY=; b=YO0rGrEH/cN4mODlbSMg3PK0co4tnfsuOD4NIbP+fTTexFzOZIPmJNaXqn1F9LYTQN 5dgFYrNipK/PN+13q2XDiqoqP6PznMqAZgdF7AmeWRSbXFWblTg/1gD7kVrAOTEoEt84 5wfitAIFD6w2Pq1wLY8GqH3YKbonpiVgoW7wJDpdWAIPfIiBwD2a2bi4WuDVv+v7f28k pxgz5QSa43n++TqzJRAbMHlzjdA5/I2ZJuNwmd/J/L4e4xXLGm1zKfq1F/DaJpbdKKSR 5skIqdZoqX74+QDeYCJ32oykHu+d3LLf9mLHyStQsGQSXh8rgmVRclnSSGmpyw/J/2mu AVrA== X-Gm-Message-State: ALyK8tK5PiSpQ5RyUvc0g0KQSpAabH1YDrf8HdOOvn+uUCaxNW23LjPrfl1/rd0zBJ8Qr082cdom1IodSGj+NA== X-Received: by 10.157.17.113 with SMTP id p46mr7992419otp.196.1466916819564; Sat, 25 Jun 2016 21:53:39 -0700 (PDT) MIME-Version: 1.0 Received: by 10.157.52.238 with HTTP; Sat, 25 Jun 2016 21:53:39 -0700 (PDT) From: Noam Postavsky Date: Sun, 26 Jun 2016 00:53:39 -0400 X-Google-Sender-Auth: APClQbRhJ5h3LcWcscG71efDBj8 Message-ID: Subject: Re: bug#17681: 24.3.91; "Arithmetic Error" in hide-ifdef mode when using shift operators To: 17681-done@debbugs.gnu.org Content-Type: text/plain; charset=UTF-8 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 17681-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) Version: 25.0.95 I see the problem in Emacs 24.5, but not Emacs 25.0.95, so it seems to have been fixed sometime in between. From unknown Mon Aug 18 14:20:56 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 24 Jul 2016 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator