From: Frank Terbeck <ft@bewatermyfriend.org>
To: 18299@debbugs.gnu.org
Subject: bug#18299: Analyzer issues warning with ~:p expansion of ‘format’
Date: Wed, 20 Aug 2014 14:26:34 +0200 [thread overview]
Message-ID: <87ha17gxdx.fsf@ft.bewatermyfriend.org> (raw)
Hello Guile developers,
I was trying this:
(use-modules (ice-9 format))
(format #t "~d block~:p~%" 1) ;; and 0, and 2 etc...
This triggers a warning about the format-string argument count:
;;; <stdin>:3:0: warning: "~d block~:p~%": wrong number of `format'
arguments: expected 2, got 1
The manual says this about "~:p":
~:p re-uses the preceding argument instead of taking a new
one, which can be convenient when printing some sort of count.
(format #t "~d cat~:p" 9) ⊣ 9 cats
(format #t "~d pupp~:@p" 5) ⊣ 5 puppies
I was looking at the code, and it appears that the warning is triggered
in "module/language/tree-il/analyze.scm" in ‘format-analysis’ and more
precisely in ‘check-format-args’, due to the lack of support for "~:p"
and presumably "~:@p" in ‘format-string-argument-count’.
Regards, Frank
--
In protocol design, perfection has been reached not when there is
nothing left to add, but when there is nothing left to take away.
-- RFC 1925
next reply other threads:[~2014-08-20 12:26 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-20 12:26 Frank Terbeck [this message]
2014-08-26 21:42 ` bug#18299: Analyzer issues warning with ~:p expansion of ‘format’ Ludovic Courtès
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87ha17gxdx.fsf@ft.bewatermyfriend.org \
--to=ft@bewatermyfriend.org \
--cc=18299@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).