From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jean Abou Samra Newsgroups: gmane.lisp.guile.user Subject: Silencing compilation warnings when calling compiler explicitly Date: Wed, 10 Aug 2022 16:42:48 +0200 Message-ID: <22174a8e-e241-f2a6-b4da-1943fec989b6@abou-samra.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31546"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.12.0 To: Guile User Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Wed Aug 10 16:43:12 2022 Return-path: Envelope-to: guile-user@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oLmvQ-00080b-Ge for guile-user@m.gmane-mx.org; Wed, 10 Aug 2022 16:43:12 +0200 Original-Received: from localhost ([::1]:33792 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oLmvP-0000aj-H1 for guile-user@m.gmane-mx.org; Wed, 10 Aug 2022 10:43:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45964) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oLmv9-0000ZY-Nz for guile-user@gnu.org; Wed, 10 Aug 2022 10:42:55 -0400 Original-Received: from mout.kundenserver.de ([217.72.192.73]:39067) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oLmv8-0002je-5G for guile-user@gnu.org; Wed, 10 Aug 2022 10:42:55 -0400 Original-Received: from [192.168.1.46] ([82.65.251.18]) by mrelayeu.kundenserver.de (mreue106 [212.227.15.184]) with ESMTPSA (Nemesis) id 1MsIbU-1nWRNo46eY-00tnLU for ; Wed, 10 Aug 2022 16:42:51 +0200 Content-Language: en-US X-Provags-ID: V03:K1:BNkggqHNY6LFkevQEtJGQu6bmLSYYZCb6HpqbUzRAHXlO5NutDw EKKmZrpFZL9r/STvnuVcp+NaJnvSGWF4F85PCilq3L3JEtwb2zwk83jd4OwF0O/cnTxkVX8 Yl5Vh++FL1KM2pDNVINpf888D63W5T+a2mId+40oGTEwGfv62Lb6moca0J0tP8hDAoM4QRs LHgFw4HoTMr95CXKfrokA== X-UI-Out-Filterresults: notjunk:1;V03:K0:XNemFQmaLLY=:cSWt8LfYJNnnXBKvnIhpmw lLOQvKYLqLCwxfqCWIwgQ9oxdL2jTwbI5MmY6TWdWNHfBhdKQZpPV23T7ed0XAUHdBnVk/0iK +uh/zrtRz4CDDxbdcwoWhrN2xYwWne9TrVp5a0r4jRl6sIZKd2Ybfj5+cCEEO84oo6Jzywg1k D19BGghFILs4V4RTq5TfIS9dIth+0FkwciCbQ3Ms6n+qGt6WT2KXKXXBqD6ozfDaOS72H0E5Z Z58S+EzRVhuCuCxFjENAGnGWLBuFuJkj9fkUnrJGYuHKJTf/LiUX1hTArzmy3+T6wVJsnNhjR lOrPMRNCXjN5cSMMxywMy8VOnghvkQtjjRYY2y8XXfhkbZbKMf1T4TSa0jzWWfRdapq63+m0U PTJGZvybvLNCO6Pie+4yWqrZQDgj9wX4SZ0u+fwNder1LElRthj5SEI8vofz2BFhvJIocu7HH EIBOBbFGUfPfSKj5t3FGMCWxS7AASyJYWqn5AHQwkBEnkQcWFqJL/Q+y+sAUI3ripGWLqpUoD G71IFQf0ZD9CuIs9oiZQUXhSqm+lTtgkGG5JvbkHninICKJtwH/H11gAzdFkd/zDXqDN+IM8J q3upqHSPec04M/+jlvzLQQEoZg1wENTUyfYWz7tHDvKpE3WaOZpcTIRfPnj2+WO7a7vXPHSES uMa1a45gpIKnoVRd/O49ZuEHl1Fm6e6sNO+5db9Gg6fFh/YNpTyLtLUhfWVvc8mCdjDW4tIAA oLU0gACQNyfFxcCqQKFn5aM72UHCyUNEhmYZ3A== Received-SPF: none client-ip=217.72.192.73; envelope-from=jean@abou-samra.fr; helo=mout.kundenserver.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.io gmane.lisp.guile.user:18514 Archived-At: Hi, I'm wondering if there is a simple way to shut up warnings emitted when calling compile in Guile 2.2. For example: (use-modules (system base compile)) (display  (compile '(lambda (x)              (case x                ((5 5) 5)                ((6) 6)))           #:env (current-module)           #:opts '(#:warnings ()))) From the code of compile in module/system/base/compile.scm (when checking out the v2.2.7 tag in the repository), it seems that the use of #:warning () in opts should turn off warnings, but this seems not to be the case, as the output is ;;; : warning: duplicate datum 5 in clause ((5 5) 5) of case expression (case x ((5 5) 5) ((6) 6)) # So far, I've found (use-modules (system base compile)) (define (make-null-port)   (make-soft-port    (vector     (lambda _ #f) ; output 1 char     (lambda _ #f) ; output string     (lambda () #f) ; flush output     #f ; get char     (lambda () #f) ; close     )    "w")) (display  (parameterize ((current-warning-port (make-null-port)))    (compile '(lambda (x)                (case x                  ((5 5) 5)                  ((6) 6)))             #:env (current-module)))) This seems a bit heavy-handed, so I'd appreciate if there is a better way. I know that in Guile 3.0 I can do #:warning-level 0, and it works, but this is for LilyPond, which has to support Guile 2.2 for now. Thanks, Jean