summaryrefslogtreecommitdiff
path: root/module/language
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2012-02-03 16:52:15 +0100
committerLudovic Courtès <ludo@gnu.org>2012-02-03 16:52:15 +0100
commitb4af80a4231c1b2296a3ee8397fdbb975692ed75 (patch)
tree24e4c32e40f5d376e81128d09609d21208795692 /module/language
parentafd08fdf87caa499abf3423c663eb44be57cceb9 (diff)
downloadguile-b4af80a4231c1b2296a3ee8397fdbb975692ed75.tar.gz
Augment `-Wformat' analysis with support for `~:h'.
* module/language/tree-il/analyze.scm (format-string-argument-count): Add support for ~h. * test-suite/tests/tree-il.test ("warnings")["format"]("~h", "~:h with locale object", "~:h without locale object"): New tests.
Diffstat (limited to 'module/language')
-rw-r--r--module/language/tree-il/analyze.scm8
1 files changed, 7 insertions, 1 deletions
diff --git a/module/language/tree-il/analyze.scm b/module/language/tree-il/analyze.scm
index 777507c76..9bcc92fdc 100644
--- a/module/language/tree-il/analyze.scm
+++ b/module/language/tree-il/analyze.scm
@@ -1,6 +1,6 @@
;;; TREE-IL -> GLIL compiler
-;; Copyright (C) 2001, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+;; Copyright (C) 2001, 2008, 2009, 2010, 2011, 2012 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
@@ -1328,6 +1328,12 @@ accurate information is missing from a given `tree-il' element."
;; We don't have enough info to determine the exact number
;; of args, but we could determine a lower bound (TODO).
(values 'any 'any))
+ ((#\h #\H)
+ (let ((argc (if (memq #\: params) 2 1)))
+ (loop (cdr chars) 'literal '()
+ conditions end-group
+ (+ argc min-count)
+ (+ argc max-count))))
(else (loop (cdr chars) 'literal '()
conditions end-group
(+ 1 min-count) (+ 1 max-count)))))