From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Bruno Haible Newsgroups: gmane.lisp.guile.bugs Subject: bug#10846: warning: non-literal format string Date: Sun, 19 Feb 2012 13:52:33 +0100 Message-ID: <16640498.OQoduWY98x@linuix> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit X-Trace: dough.gmane.org 1329655996 27925 80.91.229.3 (19 Feb 2012 12:53:16 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 19 Feb 2012 12:53:16 +0000 (UTC) Bcc: bruno@haible.de To: 10846@debbugs.gnu.org Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Sun Feb 19 13:53:15 2012 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Rz6GK-0003Td-Mi for guile-bugs@m.gmane.org; Sun, 19 Feb 2012 13:53:08 +0100 Original-Received: from localhost ([::1]:52852 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rz6GK-0006Nb-7Y for guile-bugs@m.gmane.org; Sun, 19 Feb 2012 07:53:08 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:59634) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rz6GH-0006NW-1p for bug-guile@gnu.org; Sun, 19 Feb 2012 07:53:05 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rz6G9-0006Nd-Vx for bug-guile@gnu.org; Sun, 19 Feb 2012 07:53:05 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:41705) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rz6G9-0006NZ-UO for bug-guile@gnu.org; Sun, 19 Feb 2012 07:52:57 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1Rz6IA-0000bp-IU for bug-guile@gnu.org; Sun, 19 Feb 2012 07:55:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Bruno Haible Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-guile@gnu.org Resent-Date: Sun, 19 Feb 2012 12:55:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 10846 X-GNU-PR-Package: guile X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-guile@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.13296560732303 (code B ref -1); Sun, 19 Feb 2012 12:55:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 19 Feb 2012 12:54:33 +0000 Original-Received: from localhost ([127.0.0.1]:45328 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Rz6Hg-0000b3-1x for submit@debbugs.gnu.org; Sun, 19 Feb 2012 07:54:33 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:54609) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Rz6Hd-0000aq-4w for submit@debbugs.gnu.org; Sun, 19 Feb 2012 07:54:30 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rz6FW-0006J5-1a for submit@debbugs.gnu.org; Sun, 19 Feb 2012 07:52:18 -0500 Original-Received: from lists.gnu.org ([140.186.70.17]:45748) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rz6FW-0006J1-05 for submit@debbugs.gnu.org; Sun, 19 Feb 2012 07:52:18 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:59449) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rz6FU-0005sQ-OU for bug-guile@gnu.org; Sun, 19 Feb 2012 07:52:17 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rz6FT-0006Il-KF for bug-guile@gnu.org; Sun, 19 Feb 2012 07:52:16 -0500 Original-Received: from mo-p00-ob.rzone.de ([81.169.146.162]:40119) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rz6FT-0006IY-1W for bug-guile@gnu.org; Sun, 19 Feb 2012 07:52:15 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; t=1329655933; l=1708; s=domk; d=haible.de; h=Content-Type:Content-Transfer-Encoding:MIME-Version:Date:Subject:To: From:X-RZG-CLASS-ID:X-RZG-AUTH; bh=3oHaUjTw66gWzBG4a+I2zEg1yXs=; b=w1mgPDKH5pf7mBJwvL0TA8Rqvec4LMeMwSB7h69yRptdAQ9GoUOyqECx8hgtRqC1HFa 6DR8Sm/IwjTwqS7DqTkUvFOmfLZ8mlpffEab2vNto4lH4Y8Fa6CIRP2/FNcuDEOUl+3ig pSY9UpDM32tm6YRsP2QJ7IGVGoU3clKiNGE= X-RZG-AUTH: :Ln4Re0+Ic/6oZXR1YgKryK8brksyK8dozXDwHXjf9hj/zDNRbvY44zMkpA== X-RZG-CLASS-ID: mo00 Original-Received: from linuix.haible.de (dslb-088-068-070-142.pools.arcor-ip.net [88.68.70.142]) by smtp.strato.de (cohen mo3) (RZmta 27.7 DYNA|AUTH) with ESMTPA id g03a3ao1JB1cOc ; Sun, 19 Feb 2012 13:52:00 +0100 (MET) User-Agent: KMail/4.7.4 (Linux/3.1.0-1.2-desktop; KDE/4.7.4; x86_64; ; ) X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Original-Sender: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.bugs:6223 Archived-At: Hi, With the default settings, guile's compiler warns about a format string that is returned by the gettext function. How to reproduce: ================================= prog.scm ================================= (use-modules (ice-9 format)) (setlocale LC_ALL "") (textdomain "prog") (bindtextdomain "prog" ".") (define n (string->number (list-ref (command-line) 1))) (format #t "~A~%" (gettext "'Your command, please?', asked the waiter.")) (format #t "~@?~%" (ngettext "a piece of cake" "~D pieces of cake" n) n) (format #t "~A~%" (format #f (gettext "~A is replaced by ~A.") "FF" "EUR")) ============================================================================ $ uname -srm SunOS 5.11 i86pc $ guile --version guile (GNU Guile) 2.0.3.152-c5f6c2 ... $ guile -s prog.scm 2 ;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=0 ;;; or pass the --no-auto-compile argument to disable. ;;; compiling /home/bruno/gettext-0.18.2-32-static/gettext-tools/tests/prog.scm ;;; /home/bruno/gettext-0.18.2-32-static/gettext-tools/tests/prog.scm:13:18: warning: non-literal format string ;;; compiled /home/bruno/.cache/guile/ccache/2.0-LE-4-2.0/home/bruno/gettext-0.18.2-32-static/gettext-tools/tests/prog.scm.go 'Your command, please?', asked the waiter. 2 pieces of cake FF is replaced by EUR. Given that - It is normal for a program to be internationalized, - It is normal for an internationalized program to have its format strings passed through the gettext function. such situations should not produce warnings with the default settings. It's OK in my opinion to have this warning enabled through special options or settings, though. Bruno