diff options
author | Robin Barker <RMBarker@cpan.org> | 2006-11-13 10:25:08 +0000 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2006-11-13 11:38:02 +0000 |
commit | cdfeb707a2638190212953e4a52d8460de223429 (patch) | |
tree | f8c354cdfde9c9b1601d8271086c4a4923ac2f57 /embed.pl | |
parent | 3cd0a11a1a8c5cc6b632f666275eeafcb6f5c950 (diff) | |
download | perl-cdfeb707a2638190212953e4a52d8460de223429.tar.gz |
was RE: Perl_die() / Perl_croak()
From: "Robin Barker" <Robin.Barker@npl.co.uk>
Message-ID: <2C2E01334A940D4792B3E115F95B7226149377@exchsvr1.npl.ad.local>
p4raw-id: //depot/perl@29259
Diffstat (limited to 'embed.pl')
-rwxr-xr-x | embed.pl | 12 |
1 files changed, 8 insertions, 4 deletions
@@ -232,10 +232,14 @@ sub write_protos { push @attrs, "__attribute__pure__"; } if( $flags =~ /f/ ) { - my $prefix = $has_context ? 'pTHX_' : ''; - my $args = scalar @args; - push @attrs, sprintf "__attribute__format__(__printf__,%s%d,%s%d)", - $prefix, $args - 1, $prefix, $args; + my $prefix = $has_context ? 'pTHX_' : ''; + my $args = scalar @args; + my $pat = $args - 1; + my $macro = @nonnull && $nonnull[-1] == $pat + ? '__attribute__format__' + : '__attribute__format__null_ok__'; + push @attrs, sprintf "%s(__printf__,%s%d,%s%d)", $macro, + $prefix, $pat, $prefix, $args; } if ( @nonnull ) { my @pos = map { $has_context ? "pTHX_$_" : $_ } @nonnull; |