* guix/scripts/refresh.scm:331:14: warning: non-literal format string.
@ 2015-11-09 11:30 Mathieu Lirzin
2015-11-11 21:11 ` Ludovic Courtès
0 siblings, 1 reply; 3+ messages in thread
From: Mathieu Lirzin @ 2015-11-09 11:30 UTC (permalink / raw)
To: guix-devel; +Cc: Eric Bavier
Hi,
I haved noticed a warning when building Guix (master) with Guile 2.0.11:
guix/scripts/refresh.scm:331:14: warning: non-literal format string
wrote `guix/scripts/refresh.go'
Here is the snippet of the code producing this warning:
--8<---------------cut here---------------start------------->8---
(format (current-output-port)
(N_ (N_ "A single dependent package: ~2*~{~a~}~%"
"Building the following package would ensure ~d \
dependent packages are rebuilt; ~*~{~a~^ ~}~%"
total-dependents)
"Building the following ~d packages would ensure ~d \
dependent packages are rebuilt: ~{~a~^ ~}~%"
(length rebuilds))
(length rebuilds) total-dependents rebuilds)
--8<---------------cut here---------------end--------------->8---
I'm not sure how Gettext plural forms should be used so:
- If the code is correct, I think we should provide a comment announcing
the warning and explaining why this is OK.
- else, how can we fix it?
TIA,
--
Mathieu Lirzin
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: guix/scripts/refresh.scm:331:14: warning: non-literal format string.
2015-11-09 11:30 guix/scripts/refresh.scm:331:14: warning: non-literal format string Mathieu Lirzin
@ 2015-11-11 21:11 ` Ludovic Courtès
2015-11-16 22:12 ` Mathieu Lirzin
0 siblings, 1 reply; 3+ messages in thread
From: Ludovic Courtès @ 2015-11-11 21:11 UTC (permalink / raw)
To: Mathieu Lirzin; +Cc: guix-devel, Eric Bavier
Mathieu Lirzin <mthl@gnu.org> skribis:
> Here is the snippet of the code producing this warning:
>
> (format (current-output-port)
> (N_ (N_ "A single dependent package: ~2*~{~a~}~%"
> "Building the following package would ensure ~d \
> dependent packages are rebuilt; ~*~{~a~^ ~}~%"
> total-dependents)
> "Building the following ~d packages would ensure ~d \
> dependent packages are rebuilt: ~{~a~^ ~}~%"
> (length rebuilds))
> (length rebuilds) total-dependents rebuilds)
>
> I'm not sure how Gettext plural forms should be used so:
>
> - If the code is correct, I think we should provide a comment announcing
> the warning and explaining why this is OK.
>
> - else, how can we fix it?
I believe commit 14649b8 fixes it. It was not obvious at first sight
how to untangle this, but making it two separate ‘format’ calls does the
trick.
Thanks,
Ludo’.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: guix/scripts/refresh.scm:331:14: warning: non-literal format string.
2015-11-11 21:11 ` Ludovic Courtès
@ 2015-11-16 22:12 ` Mathieu Lirzin
0 siblings, 0 replies; 3+ messages in thread
From: Mathieu Lirzin @ 2015-11-16 22:12 UTC (permalink / raw)
To: Ludovic Courtès; +Cc: guix-devel, Eric Bavier
ludo@gnu.org (Ludovic Courtès) writes:
> Mathieu Lirzin <mthl@gnu.org> skribis:
>
>> Here is the snippet of the code producing this warning:
>>
>> (format (current-output-port)
>> (N_ (N_ "A single dependent package: ~2*~{~a~}~%"
>> "Building the following package would ensure ~d \
>> dependent packages are rebuilt; ~*~{~a~^ ~}~%"
>> total-dependents)
>> "Building the following ~d packages would ensure ~d \
>> dependent packages are rebuilt: ~{~a~^ ~}~%"
>> (length rebuilds))
>> (length rebuilds) total-dependents rebuilds)
>>
>> I'm not sure how Gettext plural forms should be used so:
>>
>> - If the code is correct, I think we should provide a comment announcing
>> the warning and explaining why this is OK.
>>
>> - else, how can we fix it?
>
> I believe commit 14649b8 fixes it. It was not obvious at first sight
> how to untangle this, but making it two separate ‘format’ calls does the
> trick.
Thanks for fixing it.
--
Mathieu Lirzin
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-11-16 22:12 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-09 11:30 guix/scripts/refresh.scm:331:14: warning: non-literal format string Mathieu Lirzin
2015-11-11 21:11 ` Ludovic Courtès
2015-11-16 22:12 ` Mathieu Lirzin
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
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).