This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "GNU Guile".
http://git.savannah.gnu.org/cgit/guile.git/commit/?id=9233c05585c908b6e1612001eda51cf9c0324d91 The branch, stable-2.0 has been updated via 9233c05585c908b6e1612001eda51cf9c0324d91 (commit) via 8ac39b38d14f47b6028030fa829f1fe7d0499f21 (commit) from c6a7930b38a55aa2402f4ed722a4ef460ad67810 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 9233c05585c908b6e1612001eda51cf9c0324d91 Author: Ludovic Courtès <[email protected]> Date: Tue Aug 26 23:41:14 2014 +0200 Thank Franck. commit 8ac39b38d14f47b6028030fa829f1fe7d0499f21 Author: Ludovic Courtès <[email protected]> Date: Tue Aug 26 23:40:22 2014 +0200 Handle ~p in 'format' warnings. Fixes <http://bugs.gnu.org/18299>. Reported by Frank Terbeck <[email protected]>. * module/language/tree-il/analyze.scm (format-string-argument-count): Add case for ~p. * test-suite/tests/tree-il.test ("warnings")["format"]("~p", "~p, too few arguments", "~:p", "~:@p, too many arguments", "~:@p, too few arguments"): New tests. ----------------------------------------------------------------------- Summary of changes: THANKS | 1 + module/language/tree-il/analyze.scm | 13 +++++++++- test-suite/tests/tree-il.test | 44 +++++++++++++++++++++++++++++++++++ 3 files changed, 57 insertions(+), 1 deletions(-) diff --git a/THANKS b/THANKS index e626873..4038d5e 100644 --- a/THANKS +++ b/THANKS @@ -167,6 +167,7 @@ For fixes or providing information which led to a fix: Cesar Strauss Klaus Stehle Rainer Tammer + Frank Terbeck Samuel Thibault Richard Todd Sree Harsha Totakura diff --git a/module/language/tree-il/analyze.scm b/module/language/tree-il/analyze.scm index badce9f..ef625d4 100644 --- a/module/language/tree-il/analyze.scm +++ b/module/language/tree-il/analyze.scm @@ -1,6 +1,7 @@ ;;; TREE-IL -> GLIL compiler -;; Copyright (C) 2001, 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. +;; Copyright (C) 2001, 2008, 2009, 2010, 2011, 2012, +;; 2014 Free Software Foundation, Inc. ;;;; This library is free software; you can redistribute it and/or ;;;; modify it under the terms of the GNU Lesser General Public @@ -1273,6 +1274,16 @@ accurate information is missing from a given `tree-il' element." conditions end-group (+ 1 min-count) (+ 1 max-count))) + ((#\p #\P) (let* ((colon? (memq #\: params)) + (min-count (if colon? + (max 1 min-count) + (+ 1 min-count)))) + (loop (cdr chars) 'literal '() + conditions end-group + min-count + (if colon? + (max max-count min-count) + (+ 1 max-count))))) ((#\[) (loop chars 'literal '() '() (let ((selector (previous-number params)) diff --git a/test-suite/tests/tree-il.test b/test-suite/tests/tree-il.test index 34bc810..f892033 100644 --- a/test-suite/tests/tree-il.test +++ b/test-suite/tests/tree-il.test @@ -1698,6 +1698,50 @@ (number? (string-contains (car w) "expected 3, got 2"))))) + (pass-if "~p" + (null? (call-with-warnings + (lambda () + (compile '(((@ (ice-9 format) format) #f "thing~p" 2)) + #:opts %opts-w-format + #:to 'assembly))))) + + (pass-if "~p, too few arguments" + (let ((w (call-with-warnings + (lambda () + (compile '((@ (ice-9 format) format) #f "~p") + #:opts %opts-w-format + #:to 'assembly))))) + (and (= (length w) 1) + (number? (string-contains (car w) + "expected 1, got 0"))))) + + (pass-if "~:p" + (null? (call-with-warnings + (lambda () + (compile '(((@ (ice-9 format) format) #f "~d thing~:p" 2)) + #:opts %opts-w-format + #:to 'assembly))))) + + (pass-if "~:@p, too many arguments" + (let ((w (call-with-warnings + (lambda () + (compile '((@ (ice-9 format) format) #f "~d pupp~:@p" 5 5) + #:opts %opts-w-format + #:to 'assembly))))) + (and (= (length w) 1) + (number? (string-contains (car w) + "expected 1, got 2"))))) + + (pass-if "~:@p, too few arguments" + (let ((w (call-with-warnings + (lambda () + (compile '((@ (ice-9 format) format) #f "pupp~:@p") + #:opts %opts-w-format + #:to 'assembly))))) + (and (= (length w) 1) + (number? (string-contains (car w) + "expected 1, got 0"))))) + (pass-if "~?" (null? (call-with-warnings (lambda () hooks/post-receive -- GNU Guile
