unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* bug#26498: [PATCH] scripts: lint: Fix Guile build warning.
@ 2017-04-14 13:11 Mathieu Othacehe
  2017-04-16 10:09 ` Ludovic Courtès
  0 siblings, 1 reply; 2+ messages in thread
From: Mathieu Othacehe @ 2017-04-14 13:11 UTC (permalink / raw)
  To: 26498

* guix/scripts/lint.scm (warn-if-package-has-input): Put (_ message)
  in let, to avoid the following warning :

guix/scripts/lint.scm:251:37: warning: non-literal format string
---
 guix/scripts/lint.scm | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/guix/scripts/lint.scm b/guix/scripts/lint.scm
index 811f16706..1105dc418 100644
--- a/guix/scripts/lint.scm
+++ b/guix/scripts/lint.scm
@@ -6,6 +6,7 @@
 ;;; Copyright © 2016 Danny Milosavljevic <dannym+a@scratchpost.org>
 ;;; Copyright © 2016 Hartmut Goebel <h.goebel@crazy-compilers.com>
 ;;; Copyright © 2017 Alex Kost <alezost@gmail.com>
+;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -245,10 +246,13 @@ by two spaces; possible infraction~p at ~{~a~^, ~}")
                                  (package-name package)
                                  (if (> (length output) 0)
                                      (string-append ":" (car output))
-                                     ""))))
+                                     "")))
+                         ;; Putting tr-msg in let prevents from this
+                         ;; Guile warning: "non-literal format string".
+                         (tr-msg (_ message)))
                      (when (member input input-names)
                        (emit-warning linted
-                                     (format #f (_ message) input)
+                                     (format #f tr-msg input)
                                      'inputs-to-check)))))
                packages outputs))))
 
-- 
2.12.2

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* bug#26498: [PATCH] scripts: lint: Fix Guile build warning.
  2017-04-14 13:11 bug#26498: [PATCH] scripts: lint: Fix Guile build warning Mathieu Othacehe
@ 2017-04-16 10:09 ` Ludovic Courtès
  0 siblings, 0 replies; 2+ messages in thread
From: Ludovic Courtès @ 2017-04-16 10:09 UTC (permalink / raw)
  To: Mathieu Othacehe; +Cc: 26498-done

Hi Mathieu,

Mathieu Othacehe <m.othacehe@gmail.com> skribis:

> * guix/scripts/lint.scm (warn-if-package-has-input): Put (_ message)
>   in let, to avoid the following warning :
>
> guix/scripts/lint.scm:251:37: warning: non-literal format string
> ---
>  guix/scripts/lint.scm | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/guix/scripts/lint.scm b/guix/scripts/lint.scm
> index 811f16706..1105dc418 100644
> --- a/guix/scripts/lint.scm
> +++ b/guix/scripts/lint.scm
> @@ -6,6 +6,7 @@
>  ;;; Copyright © 2016 Danny Milosavljevic <dannym+a@scratchpost.org>
>  ;;; Copyright © 2016 Hartmut Goebel <h.goebel@crazy-compilers.com>
>  ;;; Copyright © 2017 Alex Kost <alezost@gmail.com>
> +;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
>  ;;;
>  ;;; This file is part of GNU Guix.
>  ;;;
> @@ -245,10 +246,13 @@ by two spaces; possible infraction~p at ~{~a~^, ~}")
>                                   (package-name package)
>                                   (if (> (length output) 0)
>                                       (string-append ":" (car output))
> -                                     ""))))
> +                                     "")))
> +                         ;; Putting tr-msg in let prevents from this
> +                         ;; Guile warning: "non-literal format string".
> +                         (tr-msg (_ message)))
>                       (when (member input input-names)
>                         (emit-warning linted
> -                                     (format #f (_ message) input)
> +                                     (format #f tr-msg input)

Not OK.  :-)

The warning is expected here, it warns about a real issue, which is that
we’re passing a non-literal format string.

I fixed it by decoupling the computational from the UI part in commit
1730c5b509c236a948b5a91ae6b7063384c1eee6.

Thanks,
Ludo’.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-04-16 10:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-14 13:11 bug#26498: [PATCH] scripts: lint: Fix Guile build warning Mathieu Othacehe
2017-04-16 10:09 ` Ludovic Courtès

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).