From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Philipp Klaus Krause Newsgroups: gmane.lisp.guile.bugs Subject: bug#43987: strerror return value Date: Wed, 14 Oct 2020 13:23:22 +0200 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------5EC96CFD7859589D67935348" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11828"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 To: 43987@debbugs.gnu.org Original-X-From: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Wed Oct 14 13:24:15 2020 Return-path: Envelope-to: guile-bugs@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 1kSetD-00030k-HM for guile-bugs@m.gmane-mx.org; Wed, 14 Oct 2020 13:24:15 +0200 Original-Received: from localhost ([::1]:41976 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kSetC-0001Xv-GF for guile-bugs@m.gmane-mx.org; Wed, 14 Oct 2020 07:24:14 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44012) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kSet0-0001Ws-IR for bug-guile@gnu.org; Wed, 14 Oct 2020 07:24:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:38735) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kSet0-0005Vs-8v for bug-guile@gnu.org; Wed, 14 Oct 2020 07:24:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kSet0-0004Nw-0g for bug-guile@gnu.org; Wed, 14 Oct 2020 07:24:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Philipp Klaus Krause Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Wed, 14 Oct 2020 11:24:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 43987 X-GNU-PR-Package: guile X-Debbugs-Original-To: bug-guile@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.160267461016813 (code B ref -1); Wed, 14 Oct 2020 11:24:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 14 Oct 2020 11:23:30 +0000 Original-Received: from localhost ([127.0.0.1]:50281 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kSesU-0004N6-Cc for submit@debbugs.gnu.org; Wed, 14 Oct 2020 07:23:30 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:58414) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kSesR-0004My-NB for submit@debbugs.gnu.org; Wed, 14 Oct 2020 07:23:28 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43942) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kSesR-0001Dy-Fz for bug-guile@gnu.org; Wed, 14 Oct 2020 07:23:27 -0400 Original-Received: from mout.kundenserver.de ([212.227.126.130]:41125) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kSesP-0005T2-HW for bug-guile@gnu.org; Wed, 14 Oct 2020 07:23:27 -0400 Original-Received: from [192.168.178.44] ([77.182.62.208]) by mrelayeu.kundenserver.de (mreue009 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MvsN5-1k9TES0XPr-00srxy for ; Wed, 14 Oct 2020 13:23:23 +0200 Autocrypt: addr=pkk@spth.de; prefer-encrypt=mutual; keydata= mQGiBD+wIQ0RBAD5IkcgQQIAPO93xBBvviI0htuoaeb++GqG51BImx+rnWIS+1z+r3y5jQU5 IRYS8eDC3eR5PFtde/f7/3zxaJIB0bgXB1eMPot5CaN7mpUySVNh9bzH/UP7rVH0Ut7Bx/CI 7EXxhvYE23F/TAf+gS4flFqQ/GdK+MME+dg8J5nFbwCg92xq6iuAvyz7vSho9qbKHsCD3AkE AMbuLLBvk4mPvs19aRGZvT/pows1uzkeNq8fpmzvryb4UxUbU89qlNzA2Bg8ztVZGX9x5drb C4tFE29ZFAHn2bojx2ADxG85+2as8yfcz6sPG4HMzeTtugzPGCeRAXaSknZHsw6AC6LrtsEU sjEZMElfvu8uU4dthfhXOIDVNRHmA/446GsHRLosDHFuDjHpBQJPJSBnFDyRSCge2Q0gup96 GGhNc7KkYeIB8Dh7dCN3h5RYXflVTspxmgANUa+RFpL4pynsF16rtkfeh0UR8uLdoaGwMChw GyWIdRhX8MLQ8v3WHPCUrB/1f5xhRypQgF0/c8y4w5BarGQXy7AM0PljBbQxUGhpbGlwcCBL cmF1c2UgKFN0YW5kYXJkc2NobMO8c3NlbCkgPHBra0BzcHRoLmRlPohbBBMRAgAbBQI/sCEN BgsJCAcDAgMVAgMDFgIBAh4BAheAAAoJEG7VFfsbKC6a31wAni0szX2x9jjNqqch2fE5zOkd IJsSAKCuZaayyxtHPb6rpQtbDMUTS7rXe7kCDQQ/sCFjEAgAknletShOrS5UeFH6V09TksPL 5w8S1SaQThvdberD74Uaq5We Content-Language: en-US X-Provags-ID: V03:K1:5Q/RodgrXM8UkopjaiCgqcNdSi11wO0QZlpIZmECzBP4DXyPusm lJwHt7gkoliWqysYYzvZog0qj9ENFRkFvbApBBf5eGYAV7/s1jeJ8MYL/oWiGrt1x0DUFQ6 JoAzX+02XTu2iqjm9ZuT3N3uc4VVUMlPtznSP2kLSu2+hYITWsxN8OTFW8CoMVtoTiN0ynm qTE+WhLbZO20Ih5qzl1ow== X-UI-Out-Filterresults: notjunk:1;V03:K0:pHjFuSLe5OU=:bXQgw1rIeaUnpHnKmmZFTw gr06qA+PhAx64hNwmqjYpEnAQKnZmIqr0iSQyp8Kj/GlFfdBqnjPzUJctbyLMuUUzeD0N67OZ qECmiHMAsYAM4hEZu/Vc2ZwtSfDV2BV096JLf8tTJtng0yJ/IbyCWTf4RRvcpNqvSwXIrDd8a irB6ztpfGiNthqAJsjmiPnd9lNd4NdWB1VFUoqb4asWgXWZl3Zr0WXo4fhhGmMobg9ngKOcME q8obPTiHhaFXn7tUPCBDWS+0oZNCCF4yfpbcaNE+4ewkNdVxhzm8P5OfmqNNARhV1TuM568wM 02k9LfQzlay22REt6dMT1UwK7S1j0KF4n9wumb/s2ph0egF8OQ7VD84c7e6s3oD4OgDtdGV8H zCPyqeihHsodTFFtYJj5ik/0Q1TjZU14Lkm5KyRsbkHX2wRzP8DpVO238Yj3f Received-SPF: none client-ip=212.227.126.130; envelope-from=pkk@spth.de; helo=mout.kundenserver.de X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/14 07:23:23 X-ACL-Warn: Detected OS = Linux 3.11 and newer [fuzzy] 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 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-guile" Xref: news.gmane.io gmane.lisp.guile.bugs:9899 Archived-At: This is a multi-part message in MIME format. --------------5EC96CFD7859589D67935348 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit This is just a very minor issue. libguile contains two calls to strerror where the result is used to initialize a char *. However, according to the strerror specification, the string returned by strerror should never be changed, so I think it would be better to use const char * instead. Philipp --------------5EC96CFD7859589D67935348 Content-Type: text/x-patch; charset=UTF-8; name="guile-strerror-const.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="guile-strerror-const.patch" diff --git a/libguile/posix.c b/libguile/posix.c index 47769003a..5c7bb35bd 100644 --- a/libguile/posix.c +++ b/libguile/posix.c @@ -1272,7 +1272,7 @@ renumber_file_descriptor (int fd, int err) { /* At this point we are in the child process before exec. We cannot safely raise an exception in this environment. */ - char *msg = strerror (errno); + const char *msg = strerror (errno); fprintf (fdopen (err, "a"), "start_child: dup failed: %s\n", msg); _exit (127); /* Use exit status 127, as with other exec errors. */ } @@ -1356,7 +1356,7 @@ start_child (const char *exec_file, char **exec_argv, /* The exec failed! There is nothing sensible to do. */ { - char *msg = strerror (errno); + const char *msg = strerror (errno); fprintf (fdopen (2, "a"), "In execvp of %s: %s\n", exec_file, msg); } --------------5EC96CFD7859589D67935348--