From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Francesco Potorti` Newsgroups: gmane.emacs.devel Subject: suspect error in regex.c Date: Thu, 05 Sep 2002 17:32:45 +0200 Sender: emacs-devel-admin@gnu.org Message-ID: NNTP-Posting-Host: localhost.gmane.org X-Trace: main.gmane.org 1031239955 6584 127.0.0.1 (5 Sep 2002 15:32:35 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Thu, 5 Sep 2002 15:32:35 +0000 (UTC) Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 17mycT-0001hu-00 for ; Thu, 05 Sep 2002 17:32:33 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 17mzCD-0002rV-00 for ; Thu, 05 Sep 2002 18:09:29 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 17mye3-0004fp-00; Thu, 05 Sep 2002 11:34:11 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10) id 17mycj-0004ef-00 for emacs-devel@gnu.org; Thu, 05 Sep 2002 11:32:49 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10) id 17mych-0004eF-00 for emacs-devel@gnu.org; Thu, 05 Sep 2002 11:32:48 -0400 Original-Received: from pot.cnuce.cnr.it ([146.48.83.182]) by monty-python.gnu.org with esmtp (Exim 4.10) id 17mych-0004e6-00 for emacs-devel@gnu.org; Thu, 05 Sep 2002 11:32:47 -0400 Original-Received: from pot by pot.cnuce.cnr.it with local (Exim 3.35 #1 (Debian)) id 17mycf-0007oL-00 for ; Thu, 05 Sep 2002 17:32:45 +0200 Original-To: Emacs developers X-fingerprint: 4B2 6187 5C3 D6B1 2E31 7666 9DF 2DC9 BE21 6115 Errors-To: emacs-devel-admin@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.devel:7558 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:7558 I don't know how regex.c works, but this looks strange to me (I discovered it because of a warning issued by MSVC on a report I got about etags, which uses regex.c): == src/regex.c == 1837:typedef unsigned regnum_t; in regex_compile: 2245: regnum_t regnum = 0; 2847: COMPILE_STACK_TOP.regnum = shy ? -regnum : regnum; Notice that an unsigned value is negated, then assigned to an unsigned field. later in regex_compile: 2897: regnum_t this_group_regnum; 2906: this_group_regnum = COMPILE_STACK_TOP.regnum; 2914: if (this_group_regnum <= MAX_REGNUM && this_group_regnum > 0) That is, the same unsigned value is compared against MAX_REGNUM and 0. In principle, the code could be correct, but it does sound strange to me that such a particular programming practice is not even commented. Looks suspiciously like a bug to me.