GNU bug report logs - #26498
[PATCH] scripts: lint: Fix Guile build warning.

Previous Next

Package: guix-patches;

Reported by: Mathieu Othacehe <m.othacehe <at> gmail.com>

Date: Fri, 14 Apr 2017 13:12:02 UTC

Severity: normal

Tags: patch

Done: ludo <at> gnu.org (Ludovic Courtès)

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 26498 in the body.
You can then email your comments to 26498 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#26498; Package guix-patches. (Fri, 14 Apr 2017 13:12:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Mathieu Othacehe <m.othacehe <at> gmail.com>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Fri, 14 Apr 2017 13:12:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Mathieu Othacehe <m.othacehe <at> gmail.com>
To: guix-patches <at> gnu.org
Cc: Mathieu Othacehe <m.othacehe <at> gmail.com>
Subject: [PATCH] scripts: lint: Fix Guile build warning.
Date: Fri, 14 Apr 2017 15:11:13 +0200
* 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 <at> scratchpost.org>
 ;;; Copyright © 2016 Hartmut Goebel <h.goebel <at> crazy-compilers.com>
 ;;; Copyright © 2017 Alex Kost <alezost <at> gmail.com>
+;;; Copyright © 2017 Mathieu Othacehe <m.othacehe <at> 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





Reply sent to ludo <at> gnu.org (Ludovic Courtès):
You have taken responsibility. (Sun, 16 Apr 2017 10:10:01 GMT) Full text and rfc822 format available.

Notification sent to Mathieu Othacehe <m.othacehe <at> gmail.com>:
bug acknowledged by developer. (Sun, 16 Apr 2017 10:10:02 GMT) Full text and rfc822 format available.

Message #10 received at 26498-done <at> debbugs.gnu.org (full text, mbox):

From: ludo <at> gnu.org (Ludovic Courtès)
To: Mathieu Othacehe <m.othacehe <at> gmail.com>
Cc: 26498-done <at> debbugs.gnu.org
Subject: Re: bug#26498: [PATCH] scripts: lint: Fix Guile build warning.
Date: Sun, 16 Apr 2017 12:09:20 +0200
Hi Mathieu,

Mathieu Othacehe <m.othacehe <at> 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 <at> scratchpost.org>
>  ;;; Copyright © 2016 Hartmut Goebel <h.goebel <at> crazy-compilers.com>
>  ;;; Copyright © 2017 Alex Kost <alezost <at> gmail.com>
> +;;; Copyright © 2017 Mathieu Othacehe <m.othacehe <at> 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’.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 14 May 2017 11:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 6 years and 357 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.