develooper Front page | perl.perl5.porters | Postings from September 2014

[perl #122861] [PATCH] for storage of NVs, use "IV in sv_u in head no-body trick" where possible

Thread Previous | Thread Next
From:
Father Chrysostomos via RT
Date:
September 28, 2014 17:37
Subject:
[perl #122861] [PATCH] for storage of NVs, use "IV in sv_u in head no-body trick" where possible
Message ID:
rt-4.0.18-18107-1411925857-1702.122861-15-0@perl.org
On Sun Sep 28 09:43:23 2014, bulk88 wrote:
> New patch attached. Due to issues raised on #p5p over NVU token being
> very short and therefore likely to conflict with 3rd party headers, I
> renamed it to a suggestions by dmq.

Thank you.  Applied as 5b306eef3.

However, clang is not happy about the change from size_t to U32 for arena_size:

sv.c:959:32: warning: implicit conversion from 'unsigned long' to 'U32'
      (aka 'unsigned int') changes value from 18446744073709551600 to 4294967280
      [-Wconstant-conversion]
      FIT_ARENA(0, sizeof(XPV) - STRUCT_OFFSET(XPV, xpv_cur)) },
                ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sv.c:923:26: note: expanded from macro 'FIT_ARENA'
    ? FIT_ARENAn (count, body_size)                     \
                         ^
sv.c:919:15: note: expanded from macro 'FIT_ARENAn'
    ? count * body_size                                 \
              ^

While I can go ahead and add the cast (I plan to), this 18446744073709551600 confuses me.  Where is that number coming from?  How did sizeof(XPV) - STRUCT_OFFSET(XPV, xpv_cur) end up negative (if that is what is happening)?

-- 

Father Chrysostomos


---
via perlbug:  queue: perl5 status: open
https://rt.perl.org/Ticket/Display.html?id=122861

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About