diff options
author | Timo Teräs <timo.teras@iki.fi> | 2015-08-28 08:08:57 +0000 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2015-08-28 08:27:59 +0000 |
commit | ad76680320da987e08545018d476c8dbd4060441 (patch) | |
tree | 226067fc2d1c356c95fb4d181aafbbc6e853ec6f /main/guile/0013-Handle-p-in-format-warnings.patch | |
parent | 90faba1d9dd647e1f5751208ad4d766872a043b1 (diff) | |
download | aports-ad76680320da987e08545018d476c8dbd4060441.tar.bz2 aports-ad76680320da987e08545018d476c8dbd4060441.tar.xz |
main/guile: cherry-pick patches from debian/upstream
fixes arm build among other issues
Diffstat (limited to 'main/guile/0013-Handle-p-in-format-warnings.patch')
-rw-r--r-- | main/guile/0013-Handle-p-in-format-warnings.patch | 106 |
1 files changed, 106 insertions, 0 deletions
diff --git a/main/guile/0013-Handle-p-in-format-warnings.patch b/main/guile/0013-Handle-p-in-format-warnings.patch new file mode 100644 index 0000000000..1490433f42 --- /dev/null +++ b/main/guile/0013-Handle-p-in-format-warnings.patch @@ -0,0 +1,106 @@ +From 1366d9ed223c6953df491260ecaeb3b3867006b2 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludo@gnu.org> +Date: Tue, 26 Aug 2014 23:40:22 +0200 +Subject: Handle ~p in 'format' warnings. + +Fixes <http://bugs.gnu.org/18299>. +Reported by Frank Terbeck <ft@bewatermyfriend.org>. + +* 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. + +Origin: http://git.savannah.gnu.org/cgit/guile.git/commit/?id=8ac39b38d14f47b6028030fa829f1fe7d0499f21 +Added-by: Rob Browning <rlb@defaultvalue.org> +--- + module/language/tree-il/analyze.scm | 13 ++++++++++- + test-suite/tests/tree-il.test | 44 +++++++++++++++++++++++++++++++++++++ + 2 files changed, 56 insertions(+), 1 deletion(-) + +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 () |