From: Jarkko Hietaniemi Date: Wed, 13 Jun 2001 01:05:28 +0000 (+0000) Subject: Use __attribute__((unused)) to silence -Wall on unused ax. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f022b9987cfef8a7e7c7c892f22c2e71c583bfc7;p=p5sagit%2Fp5-mst-13.2.git Use __attribute__((unused)) to silence -Wall on unused ax. p4raw-id: //depot/perl@10549 --- diff --git a/XSUB.h b/XSUB.h index cfcad5d..13c5ea9 100644 --- a/XSUB.h +++ b/XSUB.h @@ -53,9 +53,12 @@ handled automatically by C. # define XS(name) void name(pTHXo_ CV* cv) #endif +/* gcc -Wall: if an xsub has no arguments and PPCODE is used + * and none of ST, XSRETURN or XSprePUSH macros are used + * then `ax' (setup by dXSARGS) is unused. */ #define dXSARGS \ dSP; dMARK; \ - I32 ax = mark - PL_stack_base + 1; \ + I32 ax __attribute__((unused)) = mark - PL_stack_base + 1; \ I32 items = sp - mark #define dXSTARG SV * targ = ((PL_op->op_private & OPpENTERSUB_HASTARG) \ diff --git a/ext/DB_File/DB_File.xs b/ext/DB_File/DB_File.xs index 4942e25..d6d0e9e 100644 --- a/ext/DB_File/DB_File.xs +++ b/ext/DB_File/DB_File.xs @@ -136,6 +136,12 @@ * boo, hiss. */ #undef dNOOP #define dNOOP extern int Perl___notused +/* Ditto for dXSARGS. */ +#undef dXSARGS +#define dXSARGS \ + dSP; dMARK; \ + I32 ax = mark - PL_stack_base + 1; \ + I32 items = sp - mark #endif diff --git a/lib/ExtUtils/xsubpp b/lib/ExtUtils/xsubpp index 7f71234..cadbf5c 100755 --- a/lib/ExtUtils/xsubpp +++ b/lib/ExtUtils/xsubpp @@ -1220,13 +1220,6 @@ EOF # Perl_croak(aTHX_ "Usage: $pname($report_args)"); EOF - #-Wall: if an xsub has no arguments and PPCODE is used - #none of ST, XSRETURN or XSprePUSH macros are used - #hence `ax' (setup by dXSARGS) is unused - print Q<<"EOF" if $PPCODE and $num_args == 0; -# if (0) ax = ax; /* -Wall */ -EOF - print Q<<"EOF" if $PPCODE; # SP -= items; EOF