[mcclim-devel] Compiler warnings

Robert Goldman rpgoldman at sift.info
Sun Jan 23 20:35:43 UTC 2011


On 1/23/11 Jan 23 -11:59 AM, James Ashley wrote:
> 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))
> 

These are really dependency errors, not declaration errors, and we don't
really want these defined as specials.  Instead, the system definition
(presumably in mcclim.asd) should be modified to force the file that
defines +nowhere+, +everywhere+, etc. to be loaded before design.lisp.

If, for some reason, that is difficult, one could break out a separate
file with the constant definitions, and no dependencies beyond the
package-defining file, and load that early.

best,
r




More information about the mcclim-devel mailing list