Changeset 8674


Ignore:
Timestamp:
Mar 6, 2008, 10:27:23 PM (12 years ago)
Author:
gb
Message:

P2-WHINE, for whining from the backend.
Maintain a list (*WARN-IF-FUNCTION-RESULT-IGNORED*) of function names;
try to warn if they're called for effect (and results are unused.)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/working-0711/ccl/compiler/nx0.lisp

    r8666 r8674  
    18691869          *nx-warnings*)
    18701870  nil)
     1871
     1872(defun p2-whine (afunc about &rest forms)
     1873  (let* ((warning (make-condition (or (cdr (assq about *compiler-whining-conditions*)) 'compiler-warning)
     1874                                  :function-name (list (afunc-name afunc))
     1875                                  :warning-type about
     1876                                  :args (or forms (list nil)))))
     1877    (push warning (afunc-warnings afunc))
     1878    (do* ((p (afunc-parent afunc) (afunc-parent p)))
     1879         ((null p) warning)
     1880      (let* ((pname (afunc-name p)))
     1881        (push pname (compiler-warning-function-name warning))
     1882        (push warning (afunc-warnings p))))))
     1883
    18711884
    18721885(defun nx1-type-intersect (form type1 type2 &optional env)
     
    25812594  (or *nx-cur-func-name* "an anonymous function"))
    25822595
     2596(defparameter *warn-if-function-result-ignored*
     2597  '(sort stable-sort delete delete-if delete-if-not remf nreverse
     2598    nunion nset-intersection)
     2599  "Names of functions whos result(s) should ordinarily be used, because of their side-effects or lack of them.")
     2600
Note: See TracChangeset for help on using the changeset viewer.