dankogai / p5-encode

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

Silence unused var warnings from Encode #147

Closed demerphq closed 4 years ago

demerphq commented 4 years ago

Fix issue https://github.com/Perl/perl5/issues/17536 and https://github.com/dankogai/p5-encode/issues/146 and https://github.com/dankogai/p5-encode/issues/140 and https://github.com/dankogai/p5-encode/issues/143

Aliasing exposes the 'ix' variable. Since the code does not change behavior based on the alias (which is what aliases are for) the functions do not access the 'ix' variable, which throws warnings. Since Encode is core they need to be fixed.

The correct solution to this is to declare the ix variable unused by using the PERL_UNUSED_VAR(ix); macro, which this patch does.

dankogai commented 4 years ago

Thank you!