dankogai / p5-encode

Encode - character encodings (for Perl 5.8 or better)
https://metacpan.org/release/Encode
37 stars 51 forks source link

gcc warning: unused variable 'ix' #140

Closed atoomic closed 5 years ago

atoomic commented 5 years ago

notice these warnings from this build log http://perl.develop-help.com/raw/?id=223899

Compiler messages(gcc):
Encode.c:1356:5: warning: unused variable 'ix' [-Wunused-variable]
../../XSUB.h:185:20: note: expanded from macro 'dXSI32'
Encode.c:1398:5: warning: unused variable 'ix' [-Wunused-variable]
./const-xs.inc:128:42: warning: AI_IDN_ALLOW_UNASSIGNED is deprecated [-W#pragma-messages]

this is coming from dXSI32 for example in XS_EUPXS I'm not even sure it's required

atoomic commented 5 years ago

I see this is coming from the .c file generated from .xs one... where we are using aliases in XS function without having a different code for it, thus no need to use ix variable

for example in decode, the alias is just there as an alternate to decode and do not alter the code

 SV *
 decode(encoding, octets, check = NULL)
 SV *    encoding
 SV *    octets
 SV *    check
 ALIAS:
     bytes2str = 0

Looks like we cannot define XS alias without having dXSI32 loaded...

closing this case as there is nothing we can do there

pali commented 5 years ago

so looks like something for xsubpp... you can report issue to it.

atoomic commented 5 years ago

going to report it, this is a convenient feature more than anything else