[mcclim-devel] Compiler warnings

James Ashley james.ashley at gmail.com
Sun Jan 23 17:59:43 UTC 2011


I'm trying to learn McCLIM using ccl, and I just noticed several
compiler warnings during the load process. I remember that, way back
when, these were a big concern.

One set looks silly/simple enough that I think I'm qualified to submit
a patch. To deal with some variables that get defvar'd in a different
file (and a really minor typo):

--- design.lisp.original        2011-01-23 10:13:13.000000000 -0600
+++ design.lisp 2011-01-23 11:50:01.000000000 -0600
@@ -21,7 +21,7 @@

 ;;;; Some Notes

-;; The design design has a pitfall:
+;; The design has a pitfall:
 ;;
 ;; As drawing is specified, a design of class opacity carries no color
 ;; and thus borrows its color from  +foreground-ink+. So that
@@ -344,6 +344,7 @@
   0.0)

 (defun make-opacity (value)
+  (declare (special +everywhere+))      ; squash a compiler warning
   (setf value (clamp value 0 1))        ;defensive programming
   (cond ((= value 0) +transparent-ink+)
         ((= value 1) +everywhere+)      ; used to say +foreground-ink+
@@ -669,7 +670,8 @@
   design)

 (defmethod compose-in ((design design) (mask nowhere-mixin))
-  (declare (ignore design mask))
+  (declare (ignore design mask)
+          (special +nowhere+))
   +nowhere+)

 ;;; IN-COMPOSITUM
@@ -782,7 +784,8 @@
 ;;;;

 (defmethod compose-out ((design design) (mask everywhere-mixin))
-  (declare (ignore design mask))
+  (declare (ignore design mask)
+          (special +nowhere+))
   +nowhere+)

 (defmethod compose-out ((design design) (mask nowhere-mixin))
@@ -790,7 +793,8 @@
   design)

 (defmethod compose-out ((design design) (mask color))
-  (declare (ignore design mask))
+  (declare (ignore design mask)
+          (special +nowhere+))
   +nowhere+)

 (defmethod compose-out ((design design) (mask uniform-compositum))


===============================================================================

Well, AFAICT that didn't break anything...undertested newb code warning.

I don't know how to handle the rest.

Both graphics.lisp and design.lisp seem to have a very subtly
different definition of

(defmethod draw-design
   (medium (design rgb-image-design) &rest options
    &key (x 0) (y 0) &allow-other-keys)
   ...
(They seem to have different return values). This is the first time
I've knuckled down and started looking at the source code, so I don't
have the foggiest notion which definition is correct.

The defclass for standard-text-displayed-output-record in
recording.lisp has many of its slots using :start-x and :start-y for
:initarg's. This had to have been done on purpose, and it seems to
make sense in that particular situation. But how to eliminate the
compiler warnings? (I'm just going with the assumption that this is
conforming in the first place).

stream-input.lisp -- line 134, (defmethod stream-read-gesture :around
specifies *input-wait-test* as one of the default arguments. It looks
like (proclaim (special *input-wait-test*)) at some point is the right
way to fix this one. But that seems pretty heavy-handed.
*input-wait-handler* and *pointer-button-press-handler* have the same
issue, in the same lambda list. (Then again, maybe just rearranging
the load order in the ASD is the "correct" way to fix it).

bezier.lisp and regions.lisp have conflicting definitions for
(region-equal ((? point) (? point)) ...

And it looks like line 782 in bezier.lisp where
climi:with-medium-options is used before it was defined.

When I exited and restarted emacs and re-ran (require :clim) (which
very well may be the wrong way to load it), most of the warnings went
away. I don't think there was any reason for it to rebuild things the
first time, but I could be mistaken there.

I'm using the 20101006 CVS snapshot distributed via quicklisp.

Respectfully,
James




More information about the mcclim-devel mailing list