Subject: bug#26498: closed (Re: bug#26498: [PATCH] scripts: lint: Fix Guile build warning.)

From: [email-masked] (GNU bug Tracking System)
Date: Sun, 16 Apr 2017 10:10:02 +0000

Your bug report

#26498: [PATCH] scripts: lint: Fix Guile build warning.

which was filed against the guix-patches package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
26498: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=26498
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#26498: [PATCH] scripts: lint: Fix Guile build warning.
From: [email-masked] (Ludovic Courtès)
To: Mathieu Othacehe <[email-masked]>
Cc: [email-masked]
Date: Sun, 16 Apr 2017 12:09:20 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Hi Mathieu,

Mathieu Othacehe <[email-masked]> 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 <[email-masked]>
>  ;;; Copyright © 2016 Hartmut Goebel <[email-masked]>
>  ;;; Copyright © 2017 Alex Kost <[email-masked]>
> +;;; Copyright © 2017 Mathieu Othacehe <[email-masked]>
>  ;;;
>  ;;; 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’.

Subject: [PATCH] scripts: lint: Fix Guile build warning.
From: Mathieu Othacehe <[email-masked]>
To: [email-masked]
Cc: Mathieu Othacehe <[email-masked]>
Date: Fri, 14 Apr 2017 15:11:13 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

* 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 <[email-masked]>
 ;;; Copyright © 2016 Hartmut Goebel <[email-masked]>
 ;;; Copyright © 2017 Alex Kost <[email-masked]>
+;;; Copyright © 2017 Mathieu Othacehe <[email-masked]>
 ;;;
 ;;; 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