From 3b46c751d4b14431841b2a2922e83394833047bb Mon Sep 17 00:00:00 2001 From: Stas Boukarev Date: Mon, 5 Dec 2011 15:22:53 +0400 Subject: [PATCH] Remove unused variable warnings in some setf expansions. (let (list) (setf (getf list 'x 0) 10)) produced a style-warning on a temporary variable for holding 0, which is unused. Fixes lp#492071. --- src/code/early-setf.lisp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/code/early-setf.lisp b/src/code/early-setf.lisp index b8a15d4..fdcac0c 100644 --- a/src/code/early-setf.lisp +++ b/src/code/early-setf.lisp @@ -467,6 +467,7 @@ `(,newval) `(let ((,(car stores) (%putf ,get ,ptemp ,newval)) ,@(cdr stores)) + ,def-temp ;; prevent unused style-warning ,set ,newval) `(getf ,get ,ptemp ,@(if default `(,def-temp))))))) @@ -479,7 +480,8 @@ (values `(,symbol-temp ,prop-temp ,@(if default `(,def-temp))) `(,symbol ,prop ,@(if default `(,default))) (list newval) - `(%put ,symbol-temp ,prop-temp ,newval) + `(progn ,def-temp ;; prevent unused style-warning + (%put ,symbol-temp ,prop-temp ,newval)) `(get ,symbol-temp ,prop-temp ,@(if default `(,def-temp)))))) (sb!xc:define-setf-expander gethash (key hashtable &optional default) @@ -491,7 +493,8 @@ `(,key-temp ,hashtable-temp ,@(if default `(,default-temp))) `(,key ,hashtable ,@(if default `(,default))) `(,new-value-temp) - `(%puthash ,key-temp ,hashtable-temp ,new-value-temp) + `(progn ,default-temp ;; prevent unused style-warning + (%puthash ,key-temp ,hashtable-temp ,new-value-temp)) `(gethash ,key-temp ,hashtable-temp ,@(if default `(,default-temp)))))) (sb!xc:define-setf-expander logbitp (index int &environment env) -- 1.7.10.4