Magick.c: warning: unused variable

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
User avatar
yecril71pl
Posts: 81
Joined: 2011-02-08T11:06:09-07:00
Authentication code: 8675308
Location: Warsaw, Poland
Contact:

Magick.c: warning: unused variable

Post by yecril71pl »

The file Magick.c is a PERL binary extension. It generates warnings about unused variables when compiled.
Magick.c: In function 'XS_Image__Magick_Animate':
Magick.c:2483:16: warning: unused variable 'ref'
Magick.c:2477:5: warning: unused variable 'ix'
The warnings are an artefact of ExtUtils::xsubpp; I am looking for a way to get rid of them.

The sample code of perlxstut does not produce any warnings; inserting an unused variable into the implementation or a bogus parameter into the definition does produce a warning in function XS_Mytest_hello.

The minimal example of such a warning is:

Code: Select all

void
hello(x)
	ALIAS:
		do_hello = 1
	CODE:
		printf("Hello, world!\n");
with the following result:
Mytest.c: In function ‘XS_Mytest_hello’:
Mytest.c:79:5: warning: unused variable ‘ix’
and the cure for that is to use PERL_UNUSED_VAR(ix), and to drop the declaration of ref.
Post Reply