C++ compiler fix for util.c
authorGeorge Greer <perl@greerga.m-l.org>
Wed, 21 Jul 2010 08:11:51 +0000 (10:11 +0200)
committerSteffen Mueller <smueller@cpan.org>
Wed, 21 Jul 2010 08:11:51 +0000 (10:11 +0200)
Even with all of the changes, we still die on a strchr() call now
because glibc provides "correct" strchr prototypes rather than the
C ones.

C:
  char *strchr(const char *s, int c)
C++:
  const char *strchr(const char *s, int c)
  char *strchr(      char *s, int c)

and of course C++ doesn't let you convert a 'const char *' to a
'char *' so boom on util.c:3972 in Perl_grok_bslash_o (due to 'e').

util.c

diff --git a/util.c b/util.c
index 6fdc653..5bfe354 100644 (file)
--- a/util.c
+++ b/util.c
@@ -3950,7 +3950,7 @@ Perl_grok_bslash_o(pTHX_ const char *s, UV *uv, STRLEN *len, const bool output_w
  *     output_warning says whether to output any warning messages, or suppress
  *         them
  */
-    char* e;
+    const char* e;
     STRLEN numbers_len;
     I32 flags = PERL_SCAN_ALLOW_UNDERSCORES
                | PERL_SCAN_DISALLOW_PREFIX