Ignore:
Timestamp:
Mar 10, 2009, 1:32:27 PM (11 years ago)
Author:
gz
Message:

r11805/r11806 from trunk

Location:
branches/working-0711/ccl/compiler
Files:
4 edited

Legend:

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

    r11776 r11807  
    589589    (:result-ignored . "Function result ignored in call to ~s")
    590590    (:duplicate-definition . report-compile-time-duplicate-definition)
     591    (:format-error . "~:{~@?~%~}")
    591592    (:program-error . "~a")
    592593    (:unsure . "Nonspecific warning")))
  • branches/working-0711/ccl/compiler/nx.lisp

    r11701 r11807  
    204204    (:result-ignored . style-warning)
    205205    (:lambda . style-warning)
     206    (:format-error . style-warning)
    206207    (:unused . style-warning)))
    207208
  • branches/working-0711/ccl/compiler/nx0.lisp

    r11795 r11807  
    19081908        (list (%nx1-operator typed-form) type form)))))
    19091909
     1910(defvar *format-arg-functions* '((format . 1) (format-to-string . 1) (error . 0) (warn . 0)
     1911                                 (y-or-n-p . 0) (yes-or-no-p . 0)
     1912                                 (signal-simple-program-error . 0)
     1913                                 (signal-simple-condition . 1)
     1914                                 (signal-reader-error . 1)
     1915                                 (%method-combination-error . 0)
     1916                                 (%invalid-method-error . 1)
     1917                                 (nx-compile-time-error . 0)
     1918                                 (nx-error . 0)
     1919                                 (compiler-bug . 0)))
     1920
     1921#-BOOTSTRAPPED (unless (fboundp 'nx1-check-format-call) (fset 'nx1-check-format-call (lambda (&rest x) (declare (ignore x)))))
     1922
    19101923;;; Wimpy.
    19111924(defun nx1-call-result-type (sym &optional (args nil args-p) spread-p)
     
    19271940        (nx1-whine :undefined-function sym))
    19281941      (setq whined t))
     1942    (when (and args-p
     1943               (not spread-p)
     1944               (setq somedef (cdr (assq sym *format-arg-functions*)))
     1945               (setq somedef (nthcdr somedef args))
     1946               (stringp (car somedef)))
     1947      (when (nx1-check-format-call (car somedef) (cdr somedef) env)
     1948        (setq whined t)))
    19291949    (when (and args-p (setq somedef (or lexenv-def defenv-def global-def)))
    19301950      (multiple-value-bind (deftype reason)
  • branches/working-0711/ccl/compiler/optimizers.lisp

    r11686 r11807  
    19291929(define-compiler-macro format (&environment env &whole call stream string &rest args)
    19301930  (if (stringp string)
    1931     (cond ((string-equal string "~a")
     1931    (cond ((and (string-equal string "~a") args (null (cdr args)))
    19321932           (destructuring-bind (object) args
    19331933             (cond ((null stream)
     
    19401940                           (format-to-string stream ,string object)
    19411941                           (progn (princ object (and (neq stream t) stream)) nil)))))))
    1942           ((string-equal string "~s")
     1942          ((and (string-equal string "~s") args (null (cdr args)))
    19431943           (destructuring-bind (object) args
    19441944             (cond ((null stream)
Note: See TracChangeset for help on using the changeset viewer.