Little pointer juggling for HP-UX cc to avoid
authorJarkko Hietaniemi <jhi@iki.fi>
Sun, 5 Aug 2001 03:17:20 +0000 (03:17 +0000)
committerJarkko Hietaniemi <jhi@iki.fi>
Sun, 5 Aug 2001 03:17:20 +0000 (03:17 +0000)
"warning 524: Cast (non-lvalue) appears on left-hand side of assignment."
followed by
"error 1549: Modifiable lvalue required for assignment operator."

p4raw-id: //depot/perl@11578

hv.c

diff --git a/hv.c b/hv.c
index 0f57afb..d553920 100644 (file)
--- a/hv.c
+++ b/hv.c
@@ -1191,7 +1191,9 @@ Perl_newHVhv(pTHX_ HV *ohv)
        /* It's an ordinary hash, so copy it fast. AMS 20010804 */
        int i, shared = !!HvSHAREKEYS(ohv);
        HE **ents, **oents = (HE **)HvARRAY(ohv);
-       New(0, (char *)ents, PERL_HV_ARRAY_ALLOC_BYTES(hv_max+1), char);
+       char *a;
+       New(0, a, PERL_HV_ARRAY_ALLOC_BYTES(hv_max+1), char);
+       ents = (HE**)a;
 
        /* In each bucket... */
        for (i = 0; i <= hv_max; i++) {