This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
locale.c: Really silence compiler warning
authorKarl Williamson <khw@cpan.org>
Thu, 15 Mar 2018 17:37:16 +0000 (11:37 -0600)
committerKarl Williamson <khw@cpan.org>
Wed, 21 Mar 2018 13:43:40 +0000 (07:43 -0600)
Commit 32a62865ef662fce2b2250a7e0eca15861e7fe20 did not work, as gcc
doesn't recognize a void cast as handling a return value.  This should
hopefully work, though we discard the value before looking at it, which
could cause another warning.

locale.c

index 835837b..67a2997 100644 (file)
--- a/locale.c
+++ b/locale.c
@@ -2598,7 +2598,7 @@ S_my_nl_langinfo(const int item, bool toggle)
 
                     /* Here everything past the dot is a digit.  Treat it as a
                      * code page */
-                    (void) save_to_buffer("CP", &PL_langinfo_buf,
+                    retval = save_to_buffer("CP", &PL_langinfo_buf,
                                                 &PL_langinfo_bufsize, 0);
                     offset = STRLENs("CP");