emacs-bug-tracker
[Top][All Lists]
Advanced

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

[debbugs-tracker] bug#18299: closed (Analyzer issues warning with ~:p ex


From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#18299: closed (Analyzer issues warning with ~:p expansion of ‘format’)
Date: Tue, 26 Aug 2014 21:43:02 +0000

Your message dated Tue, 26 Aug 2014 23:42:22 +0200
with message-id <address@hidden>
and subject line Re: bug#18299: Analyzer issues warning with ~:p expansion of 
‘format’
has caused the debbugs.gnu.org bug report #18299,
regarding Analyzer issues warning with ~:p expansion of ‘format’
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden)


-- 
18299: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=18299
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: Analyzer issues warning with ~:p expansion of ‘format’ Date: Wed, 20 Aug 2014 14:26:34 +0200 User-agent: Gnus/5.130008 (Ma Gnus v0.8) Emacs/24.3.50 (gnu/linux)
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



--- End Message ---
--- Begin Message --- Subject: Re: bug#18299: Analyzer issues warning with ~:p expansion of ‘format’ Date: Tue, 26 Aug 2014 23:42:22 +0200 User-agent: Gnus/5.130011 (Ma Gnus v0.11) Emacs/24.3 (gnu/linux)
Frank Terbeck <address@hidden> skribis:

> 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

I believe commit 8ac39b3 fixes it.  It will be in 2.0.12.

Thanks!

Ludo’.


--- End Message ---

reply via email to

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