GNU bug report logs - #43987
strerror return value

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: guile; Reported by: Philipp Klaus Krause <pkk@HIDDEN>; dated Wed, 14 Oct 2020 11:24:01 UTC; Maintainer for guile is bug-guile@HIDDEN.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 14 Oct 2020 11:23:30 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Oct 14 07:23:30 2020
Received: from localhost ([127.0.0.1]:50281 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kSesU-0004N6-Cc
	for submit <at> debbugs.gnu.org; Wed, 14 Oct 2020 07:23:30 -0400
Received: from lists.gnu.org ([209.51.188.17]:58414)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <pkk@HIDDEN>) id 1kSesR-0004My-NB
 for submit <at> debbugs.gnu.org; Wed, 14 Oct 2020 07:23:28 -0400
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 <pkk@HIDDEN>) id 1kSesR-0001Dy-Fz
 for bug-guile@HIDDEN; Wed, 14 Oct 2020 07:23:27 -0400
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 <pkk@HIDDEN>) id 1kSesP-0005T2-HW
 for bug-guile@HIDDEN; Wed, 14 Oct 2020 07:23:27 -0400
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 <bug-guile@HIDDEN>; Wed, 14 Oct 2020 13:23:23
 +0200
To: bug-guile@HIDDEN
From: Philipp Klaus Krause <pkk@HIDDEN>
Subject: strerror return value
Autocrypt: addr=pkk@HIDDEN; 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
 5w8S1SaQThvdberD74Uaq5Weoeu5fCzeDlhRvTC+wQFxL5W2wdM3ZhqRpZIri7X3ab/WUsqv
 0FCK8LB9HfioafjNg7uQbyUannvyBkj4WAfHrTDgDbNw8EJMehab9MUeCUZEkhXrk9b3rp3r
 /uoic1pymK0aZX+wUfayXGANAAk75HAruEWxpGObjcJ587tTOsfDAFnJlXKXLVXuqJDSraym
 ankbEfyX1CmfhetYn+s1fCpAHX/GOIQPEG2BCdeLdy8ApN0l6MIrRkJKbBnvnc8HsUI7Elfu
 huemyI/Nvhxk5+tuOS5kZBIyZKe8CwADBQf+InHwn00dafe8XNod9jRsHgCqE259ocEiL0Zs
 rw3NfwbckR6YVGtoovHna6I3+o4F4GPS/869WFw/w1HGGsa9t6SRjWeoH221bxYc+aTstGbA
 hd9OuDXnXFi9Mokh34cXQexvrVYjfOdbAl9TRezPBRygzr6XvUdUtIpZjZhW0WSdhdF67Obl
 F+S9kCX7v3Q0kSqnjzk05Qs5kHyaE+7BKiGQhvCz51J++CTCc/g16eOVVabHNLalAEInq1jn
 jAB15+JxDcA3HFup7+sHkkscAEQPPi8aNnWR32su0w9hfE1qQkvyHhOiPX2GVhm/Lt0C1vGr
 ZCB9Bve3r8M+Z7uMaohGBBgRAgAGBQI/sCFjAAoJEG7VFfsbKC6aQ4oAnibaEjyIlrRMTmyL
 K76lqhloK0EPAKCQsgCELscmeJnxyjV1zZt6AJ6ctQ==
Message-ID: <df1eb171-2a28-2bd1-cb69-454980a19461@HIDDEN>
Date: Wed, 14 Oct 2020 13:23:22 +0200
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101
 Thunderbird/68.12.0
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="------------5EC96CFD7859589D67935348"
Content-Language: en-US
X-Provags-ID: V03:K1:5Q/RodgrXM8UkopjaiCgqcNdSi11wO0QZlpIZmECzBP4DXyPusm
 lJwHt7gkoliWqysYYzvZog0qj9ENFRkFvbApBBf5eGYAV7/s1jeJ8MYL/oWiGrt1x0DUFQ6
 JoAzX+02XTu2iqjm9ZuT3N3uc4VVUMlPtznSP2kLSu2+hYITWsxN8OTFW8CoMVtoTiN0ynm
 qTE+WhLbZO20Ih5qzl1ow==
X-Spam-Flag: NO
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@HIDDEN;
 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-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

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--




Acknowledgement sent to Philipp Klaus Krause <pkk@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-guile@HIDDEN. Full text available.
Report forwarded to bug-guile@HIDDEN:
bug#43987; Package guile. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Wed, 14 Oct 2020 11:30:02 UTC

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