|
From: | Alex Shinn |
Subject: | Re: [Chicken-hackers] [PATCH] Get rid of irregex compilation warnings |
Date: | Sat, 10 Nov 2012 12:36:22 +0900 |
Hi all,
Attached are two patches to get rid of the warnings that are emitted
when compiling irregex.
The first patch is one to get rid of a scrutinizer warning, which has
also already been applied upstream. This is due to some code that
looks like this: `(foo ,(cddr x) (if (pair? (cdr x)) (cadr x) 'epsilon))
Checking whether cdr x is a pair at the same level in the _expression_
where the cdr is already unconditionally taken is wrong. This code is
trying to determine whether the _expression_ is empty and return 'epsilon
then (but it's looking at the wrong part of the tree). sre-sequence
already returns 'epsilon when passed an empty list.
I don't think this really is a bug as such, since I wasn't able to
trigger the code to take the cdr in a case where it's nil, but this
patch eliminates the annoying warnings and gives me a warm fuzzy feeling.
It also simplifies the code a little.
The second patch is simply to get rid of all the warnings that are
generated because the irregex.scm file overwrites some definitions
that occur in irregex-core.scm with more efficient implementations.
There are also a handful of procedures that really aren't unused, even
in upstream irregex. Some of those are for debugging, others are
never used (but were in the past, or might in the future).
I don't think this is critical, but it's nice to reduce the clutter
and have a cleanly compiling Chicken (even if it's a white lie).
Cheers,
Peter
--
http://sjamaan.ath.cx
--
"The process of preparing programs for a digital computer
is especially attractive, not only because it can be economically
and scientifically rewarding, but also because it can be an aesthetic
experience much like composing poetry or music."
-- Donald Knuth
_______________________________________________
Chicken-hackers mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/chicken-hackers
[Prev in Thread] | Current Thread | [Next in Thread] |