Changeset 13187


Ignore:
Timestamp:
Nov 11, 2009, 1:06:00 AM (10 years ago)
Author:
gz
Message:

warn about too many arguments in format strings

Location:
trunk/source
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/compiler/X86/x86-lap.lisp

    r13067 r13187  
    696696            (if (not (or disp base index))
    697697              (setq disp (parse-x86-lap-expression head))
    698               (error "~& not expected in ~s" head form)))))))))
     698              (error "~&~s not expected in ~s" head form)))))))))
    699699
    700700     
  • trunk/source/level-1/l1-error-system.lisp

    r13067 r13187  
    396396   (lambda (c s)
    397397     (let* ((p (package-error-package c)))
    398        (format s "The following symbols need to be imported to ~S before they can be exported ~& from that package:~%~s:" p (slot-value c 'to-be-imported) p)))))
     398       (format s "The following symbols need to be imported to ~S before they can be exported ~& from that package:~%~s:" p (slot-value c 'to-be-imported))))))
    399399
    400400
  • trunk/source/level-1/linux-files.lisp

    r13121 r13187  
    846846    (%setf-macptr p (#_strerror errno))
    847847    (if (%null-ptr-p p)
    848       (format nil "OS Error %d" errno)
     848      (format nil "OS Error ~d" errno)
    849849      (%get-cstring p))))
    850850
  • trunk/source/lib/format.lisp

    r13067 r13187  
    22272227        (sub-format-scan 0 (length *format-control-string*))
    22282228        (note-format-scan-option *format-escape-options*)))
    2229     #+no
    22302229    (when (> (length *format-arguments*) *format-arguments-variance*)
    22312230      (format-error "Too many format arguments"))))
     
    26082607            ((< count 0)
    26092608             (let* ((orig *format-original-arguments*)
    2610                     (pos (+ (- (length orig) (length *format-arguments*)) count))
     2609                    (orig-pos (- (length orig) (length *format-arguments*)))
     2610                    (pos (+ orig-pos count))
    26112611                    (max-pos (+ pos (or *format-arguments-variance* 0))))
    26122612               (when (< max-pos 0)
    26132613                 (format-error "Target position for ~~* out of bounds"))
     2614               ;; After backing up, we may not use up all the arguments we backed over.
     2615               ;; Increase the variance allowed to cover those arguments, so we don't
     2616               ;; complain about not using them.  E.g. (format t "~a ~a ~2:*~a" 1 2) should
     2617               ;; be ok, (format t "~a ~a ~2:*" 1 2) should warn.
     2618               (setq max-pos (1- (- max-pos count)))
    26142619               (if (< pos 0)
    26152620                 (setq *format-arguments* orig
    26162621                       *format-arguments-variance* max-pos)
    2617                  (setq *format-arguments* (nthcdr pos orig)))))))))
    2618 
     2622                 (setq *format-arguments* (nthcdr pos orig)
     2623                       *format-arguments-variance* (- max-pos pos)))))))))
  • trunk/source/lib/macros.lisp

    r13080 r13187  
    25982598      (if (and type (not (eq type :void)))
    25992599          (format stream "[:~A] ~A~%" type val)
    2600         (format stream ":VOID~%" val))))))
     2600        (format stream ":VOID~%"))))))
    26012601
    26022602(defun def-trace-print-function (type fn)
Note: See TracChangeset for help on using the changeset viewer.