On Fri, 03 Jul 2009, Jan Dubois wrote:
> The 2 remaining ones are:
> 
>                     sv_setpvf(subname_sv, "%s::__UNKNOWN__[0x%lx]",
>                         (stash_name)?stash_name:"__UNKNOWN__", (unsigned 
> long)cv);
> 
> NYTProf.xs(2349) : warning C4311: 'type cast' : pointer truncation from 'CV 
> *' to 'unsigned long'
> 
> On 64-bit Windows you are throwing away the top 32 bits of the CV
> pointer. I don't think there is a cross-platform solution for formatting
> a size_t sized integer with printf format codes. Should I put in an
> alternate implementation via conditional compilation for Windows
> (using %Ix for the format and size_t for the cast)?

I just went ahead and submitted it as r799:

http://code.google.com/p/perl-devel-nytprof/source/detail?r=799

> 
>                 I32 save_ix = SSNEWa(sizeof(sub_call_start), MEM_ALIGNBYTES);
> 
> NYTProf.xs(2446) : warning C4311: 'type cast' : pointer truncation from 
> 'caddr_t' to 'int'
> 
> This warnings comes from the SSNEWa() macro in scope.h from the core, so
> it can't be fixed by NYTProf:
> 
> #define SSNEWa(size,align)      Perl_save_alloc(aTHX_ (size), \
>     (align - ((int)((caddr_t)&PL_savestack[PL_savestack_ix]) % align)) % 
> align)
> 
> The second parameter to Perl_save_alloc() needs to be cast to I32.
> This one gets rid of the warning for Win64:
> 
> #define SSNEWa(size,align)      Perl_save_alloc(aTHX_ (size), \
>     (I32)(align - ((size_t)((caddr_t)&PL_savestack[PL_savestack_ix]) % 
> align)) % align)

I also committed this one to blead:

http://perl5.git.perl.org/perl.git/commitdiff/6b99f28a36db89d4a6baa5b8598d15bfe4b998cb?hp=af048c18889d4232ba48aa87bdd20a2320723b43

This results in a Win64 compilation without _any_ warnings.

Cheers,
-Jan


--~--~---------~--~----~------------~-------~--~----~
You've received this message because you are subscribed to
the Devel::NYTProf Development User group.

Group hosted at:  http://groups.google.com/group/develnytprof-dev
Project hosted at:  http://perl-devel-nytprof.googlecode.com
CPAN distribution:  http://search.cpan.org/dist/Devel-NYTProf

To post, email:  [email protected]
To unsubscribe, email:  [email protected]
-~----------~----~----~----~------~----~------~--~---

Reply via email to