[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#13485: wrong warning for format ~!

From: Ian Price
Subject: bug#13485: wrong warning for format ~!
Date: Fri, 18 Jan 2013 21:36:59 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux)

Daniel Llorens <address@hidden> writes:

> In 2.0.7
> scheme@(guile-user)> (import (ice-9 format))
> scheme@(guile-user)> (format #t "~!")
> ;;; <stdin>:2:0: warning: "~!": wrong number of `format' arguments: expected 
> 1, got 0
> $1 = #t
> scheme@(guile-user)> (format #t "~!" 3)
> $2 = #t
> scheme@(guile-user)> (format #t "~!~a" 3 9)  
> 3$3 = #t
> scheme@(guile-user)> (format #t "~a~!" 3 9)  
> 3$4 = #t
> scheme@(guile-user)> (version)
> $5 = ""
> So it doesn't take an argument, it only affects the warning.
Okay, I've confirmed this, and as far as I've been able to determine you
are correct. The problem only seems to be with the warning, not format

In format-string-argument-count in the module
module/language/tree-il/analyze.scm the ~! option gets picked up by the
else case of the loop, which adds one to both the max and minimum number
of parameters. Clearly this is a mistake.

I'm currently looking through the format docs to see if any others are
mishandled, and will post a patch later.

PS. I'm really glad this wasn't a bug in format, since that is one scary
function. :)

Ian Price -- shift-reset.com

"Programming is like pinball. The reward for doing it well is
the opportunity to do it again" - from "The Wizardy Compiled"

reply via email to

[Prev in Thread] Current Thread [Next in Thread]