Skip Menu |

This queue is for tickets about the Class-XSConstructor CPAN distribution.

Report information
The Basics
Id: 125636
Status: resolved
Priority: 0/
Queue: Class-XSConstructor

People
Owner: Nobody in particular
Requestors: bkb [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Compiler warnings with clang on freebsd
Compiling with clang on freebsd, noticed the following compiler warnings The following compiler warning is a problem: XSConstructor.xs:127:19: warning: incompatible pointer types passing 'I32 *' (aka 'long *') to parameter of type 'STRLEN *' (aka 'unsigned int *') [-Wincompatible-pointer-types] keyname = SvPV(attr, keylen); ^ Make keylen a STRLEN not an I32 to avoid crashes on 64 bit machines. This module might help: https://metacpan.org/pod/distribution/XS-Check/lib/XS/Check.pod This is strange: XSConstructor.xs:141:17: warning: initializing 'char *const' with an expression of type 'const char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers] char* const klass = sv_reftype(SvRV(object), 1); ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~ char * const klass means that the value of "klass" itself is constant, not the thing it's pointing to, which is what you should have here. I don't know if this is helpful but it goes into more detail about the STRLEN issue: https://www.lemoda.net/perl/perl-xs-cpan-testers/index.html
There are a whole bunch of warnings. I'll try to fix these ones today. Can you tell I'm not normally a C coder?
0.006 builds with no errors, warnings, or notes. (On my computer at least.)