From unknown Fri Aug 15 20:28:37 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10846: warning: non-literal format string 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: To: 10846@debbugs.gnu.org X-Debbugs-Original-To: bug-guile@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.13296560732303 (code B ref -1); Sun, 19 Feb 2012 12:55:02 +0000 Received: (at submit) by debbugs.gnu.org; 19 Feb 2012 12:54:33 +0000 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 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 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 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, T_DKIM_INVALID autolearn=unavailable version=3.3.2 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 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 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 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 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) From: Bruno Haible Date: Sun, 19 Feb 2012 13:52:33 +0100 Message-ID: <16640498.OQoduWY98x@linuix> User-Agent: KMail/4.7.4 (Linux/3.1.0-1.2-desktop; KDE/4.7.4; x86_64; ; ) MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" 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-Received-From: 140.186.70.17 X-Spam-Score: -4.2 (----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.2 (----) 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 From unknown Fri Aug 15 20:28:37 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.428 (Entity 5.428) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Bruno Haible Subject: bug#10846: closed (Re: bug#10846: warning: non-literal format string) Message-ID: References: <87aa4ewhw2.fsf@gnu.org> <16640498.OQoduWY98x@linuix> X-Gnu-PR-Message: they-closed 10846 X-Gnu-PR-Package: guile Reply-To: 10846@debbugs.gnu.org Date: Sun, 19 Feb 2012 23:01:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1329692462-5642-1" This is a multi-part message in MIME format... ------------=_1329692462-5642-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #10846: warning: non-literal format string which was filed against the guile package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 10846@debbugs.gnu.org. --=20 10846: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D10846 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1329692462-5642-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 10846-done) by debbugs.gnu.org; 19 Feb 2012 23:00:02 +0000 Received: from localhost ([127.0.0.1]:46275 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RzFje-0001RA-1p for submit@debbugs.gnu.org; Sun, 19 Feb 2012 18:00:02 -0500 Received: from xanadu.aquilenet.fr ([88.191.123.111]:60560) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RzFjb-0001QZ-Ic for 10846-done@debbugs.gnu.org; Sun, 19 Feb 2012 18:00:00 -0500 Received: from localhost (xanadu.aquilenet.fr [127.0.0.1]) by xanadu.aquilenet.fr (Postfix) with ESMTP id 0B9866C74; Sun, 19 Feb 2012 23:57:51 +0100 (CET) Received: from xanadu.aquilenet.fr ([127.0.0.1]) by localhost (xanadu.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id UILQ-fzTO9Fl; Sun, 19 Feb 2012 23:57:50 +0100 (CET) Received: from pluto (reverse-83.fdn.fr [80.67.176.83]) by xanadu.aquilenet.fr (Postfix) with ESMTPSA id 60A606C57; Sun, 19 Feb 2012 23:57:50 +0100 (CET) From: ludo@gnu.org (Ludovic =?iso-8859-1?Q?Court=E8s?=) To: Bruno Haible Subject: Re: bug#10846: warning: non-literal format string References: <16640498.OQoduWY98x@linuix> Date: Sun, 19 Feb 2012 23:57:49 +0100 In-Reply-To: <16640498.OQoduWY98x@linuix> (Bruno Haible's message of "Sun, 19 Feb 2012 13:52:33 +0100") Message-ID: <87aa4ewhw2.fsf@gnu.org> User-Agent: Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.93 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -1.2 (-) X-Debbugs-Envelope-To: 10846-done Cc: 10846-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.2 (-) Hi Bruno, Bruno Haible skribis: > Given that > - It is normal for a program to be internationalized, > - It is normal for an internationalized program to have its format stri= ngs > passed through the gettext function. > such situations should not produce warnings with the default settings. Thanks, fixed here: http://git.savannah.gnu.org/cgit/guile.git/commit/?h=3Dstable-2.0&id=3Daf= c9803113de660a761f476b7957e92cc60bad19 http://git.savannah.gnu.org/cgit/guile.git/commit/?h=3Dstable-2.0&id=3D98= 385ed20abdc191a67daef8a00b1df0290a074a > It's OK in my opinion to have this warning enabled through special options > or settings, though. The =E2=80=98format=E2=80=99 warning is in =E2=80=98%auto-compilation-optio= ns=E2=80=99, but it can be turned off at the user=E2=80=99s option. Thanks, Ludo=E2=80=99. ------------=_1329692462-5642-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 19 Feb 2012 12:54:33 +0000 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 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 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 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, T_DKIM_INVALID autolearn=unavailable version=3.3.2 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 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 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 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 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) From: Bruno Haible To: bug-guile@gnu.org Bcc: bruno@haible.de Subject: warning: non-literal format string Date: Sun, 19 Feb 2012 13:52:33 +0100 Message-ID: <16640498.OQoduWY98x@linuix> User-Agent: KMail/4.7.4 (Linux/3.1.0-1.2-desktop; KDE/4.7.4; x86_64; ; ) MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" 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-Received-From: 140.186.70.17 X-Spam-Score: -4.2 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.2 (----) 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 ------------=_1329692462-5642-1--