summaryrefslogtreecommitdiff
path: root/embed.pl
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>2000-01-22 10:06:53 +0000
committerGurusamy Sarathy <gsar@cpan.org>2000-01-22 10:06:53 +0000
commit894356b32151f778d4d2915c6db38e5d049b115a (patch)
tree80e9c55bdd3e19adc9d1ef8cc20c50b2f7756b9d /embed.pl
parentf30a114324770080b9e0b2bcfb9c2278f5e0a290 (diff)
downloadperl-894356b32151f778d4d2915c6db38e5d049b115a.tar.gz
add patch for printf-style format typechecks (from Robin Barker
<rmb1@cise.npl.co.uk>); fixes for problems so identified p4raw-id: //depot/perl@4836
Diffstat (limited to 'embed.pl')
-rwxr-xr-xembed.pl61
1 files changed, 35 insertions, 26 deletions
diff --git a/embed.pl b/embed.pl
index f235ffb170..52ab63a186 100755
--- a/embed.pl
+++ b/embed.pl
@@ -134,6 +134,14 @@ sub write_protos {
}
$ret .= ")";
$ret .= " __attribute__((noreturn))" if $flags =~ /r/;
+ if( $flags =~ /f/ ) {
+ my $prefix = $flags =~ /n/ ? '' : 'pTHX_';
+ my $args = scalar @args;
+ $ret .= "\n#ifdef CHECK_FORMAT\n";
+ $ret .= sprintf " __attribute__((format(printf,%s%d,%s%d)))",
+ $prefix, $args - 1, $prefix, $args;
+ $ret .= "\n#endif\n";
+ }
$ret .= ";\n";
}
$ret;
@@ -1006,6 +1014,7 @@ __END__
: file
: n has no implicit interpreter/thread context argument
: p function has a Perl_ prefix
+: f function takes printf style format string, varargs
: r function never returns
: o has no compatibility macro (#define foo Perl_foo)
: j not a member of CPerlObj
@@ -1124,22 +1133,22 @@ p |I32 |my_chsize |int fd|Off_t length
p |MAGIC* |condpair_magic |SV *sv
#endif
p |OP* |convert |I32 optype|I32 flags|OP* o
-pr |void |croak |const char* pat|...
+fpr |void |croak |const char* pat|...
pr |void |vcroak |const char* pat|va_list* args
#if defined(PERL_IMPLICIT_CONTEXT)
-nrp |void |croak_nocontext|const char* pat|...
-np |OP* |die_nocontext |const char* pat|...
-np |void |deb_nocontext |const char* pat|...
-np |char* |form_nocontext |const char* pat|...
-np |SV* |mess_nocontext |const char* pat|...
-np |void |warn_nocontext |const char* pat|...
-np |void |warner_nocontext|U32 err|const char* pat|...
-np |SV* |newSVpvf_nocontext|const char* pat|...
-np |void |sv_catpvf_nocontext|SV* sv|const char* pat|...
-np |void |sv_setpvf_nocontext|SV* sv|const char* pat|...
-np |void |sv_catpvf_mg_nocontext|SV* sv|const char* pat|...
-np |void |sv_setpvf_mg_nocontext|SV* sv|const char* pat|...
-np |int |fprintf_nocontext|PerlIO* stream|const char* fmt|...
+fnrp |void |croak_nocontext|const char* pat|...
+fnp |OP* |die_nocontext |const char* pat|...
+fnp |void |deb_nocontext |const char* pat|...
+fnp |char* |form_nocontext |const char* pat|...
+fnp |SV* |mess_nocontext |const char* pat|...
+fnp |void |warn_nocontext |const char* pat|...
+fnp |void |warner_nocontext|U32 err|const char* pat|...
+fnp |SV* |newSVpvf_nocontext|const char* pat|...
+fnp |void |sv_catpvf_nocontext|SV* sv|const char* pat|...
+fnp |void |sv_setpvf_nocontext|SV* sv|const char* pat|...
+fnp |void |sv_catpvf_mg_nocontext|SV* sv|const char* pat|...
+fnp |void |sv_setpvf_mg_nocontext|SV* sv|const char* pat|...
+fnp |int |fprintf_nocontext|PerlIO* stream|const char* fmt|...
#endif
p |void |cv_ckproto |CV* cv|GV* gv|char* p
p |CV* |cv_clone |CV* proto
@@ -1156,7 +1165,7 @@ p |char* |get_no_modify
p |U32* |get_opargs
p |PPADDR_t*|get_ppaddr
p |I32 |cxinc
-p |void |deb |const char* pat|...
+fp |void |deb |const char* pat|...
p |void |vdeb |const char* pat|va_list* args
p |void |debprofdump
p |I32 |debop |OP* o
@@ -1165,7 +1174,7 @@ p |I32 |debstackptrs
p |char* |delimcpy |char* to|char* toend|char* from \
|char* fromend|int delim|I32* retlen
p |void |deprecate |char* s
-p |OP* |die |const char* pat|...
+fp |OP* |die |const char* pat|...
p |OP* |vdie |const char* pat|va_list* args
p |OP* |die_where |char* message|STRLEN msglen
p |void |dounwind |I32 cxix
@@ -1230,7 +1239,7 @@ p |PADOFFSET|find_threadsv|const char *name
#endif
p |OP* |force_list |OP* arg
p |OP* |fold_constants |OP* arg
-p |char* |form |const char* pat|...
+fp |char* |form |const char* pat|...
p |char* |vform |const char* pat|va_list* args
p |void |free_tmps
p |OP* |gen_constant_list|OP* o
@@ -1405,7 +1414,7 @@ p |void |markstack_grow
#if defined(USE_LOCALE_COLLATE)
p |char* |mem_collxfrm |const char* s|STRLEN len|STRLEN* xlen
#endif
-p |SV* |mess |const char* pat|...
+fp |SV* |mess |const char* pat|...
p |SV* |vmess |const char* pat|va_list* args
p |void |qerror |SV* err
p |int |mg_clear |SV* sv
@@ -1493,7 +1502,7 @@ p |SV* |newSViv |IV i
p |SV* |newSVnv |NV n
p |SV* |newSVpv |const char* s|STRLEN len
p |SV* |newSVpvn |const char* s|STRLEN len
-p |SV* |newSVpvf |const char* pat|...
+fp |SV* |newSVpvf |const char* pat|...
p |SV* |vnewSVpvf |const char* pat|va_list* args
p |SV* |newSVrv |SV* rv|const char* classname
p |SV* |newSVsv |SV* old
@@ -1668,7 +1677,7 @@ p |I32 |sv_true |SV *sv
p |void |sv_add_arena |char* ptr|U32 size|U32 flags
p |int |sv_backoff |SV* sv
p |SV* |sv_bless |SV* sv|HV* stash
-p |void |sv_catpvf |SV* sv|const char* pat|...
+fp |void |sv_catpvf |SV* sv|const char* pat|...
p |void |sv_vcatpvf |SV* sv|const char* pat|va_list* args
p |void |sv_catpv |SV* sv|const char* ptr
p |void |sv_catpvn |SV* sv|const char* ptr|STRLEN len
@@ -1713,7 +1722,7 @@ p |char* |sv_reftype |SV* sv|int ob
p |void |sv_replace |SV* sv|SV* nsv
p |void |sv_report_used
p |void |sv_reset |char* s|HV* stash
-p |void |sv_setpvf |SV* sv|const char* pat|...
+fp |void |sv_setpvf |SV* sv|const char* pat|...
p |void |sv_vsetpvf |SV* sv|const char* pat|va_list* args
p |void |sv_setiv |SV* sv|IV num
p |void |sv_setpviv |SV* sv|IV num
@@ -1768,9 +1777,9 @@ p |void |vivify_ref |SV* sv|U32 to_what
p |I32 |wait4pid |Pid_t pid|int* statusp|int flags
p |void |report_closed_fh|GV *gv|IO *io|const char *func|const char *obj
p |void |report_uninit
-p |void |warn |const char* pat|...
+fp |void |warn |const char* pat|...
p |void |vwarn |const char* pat|va_list* args
-p |void |warner |U32 err|const char* pat|...
+fp |void |warner |U32 err|const char* pat|...
p |void |vwarner |U32 err|const char* pat|va_list* args
p |void |watch |char** addr
p |I32 |whichsig |char* sig
@@ -1800,12 +1809,12 @@ p |struct perl_vars *|GetVars
#endif
p |int |runops_standard
p |int |runops_debug
-p |void |sv_catpvf_mg |SV *sv|const char* pat|...
+fp |void |sv_catpvf_mg |SV *sv|const char* pat|...
p |void |sv_vcatpvf_mg |SV* sv|const char* pat|va_list* args
p |void |sv_catpv_mg |SV *sv|const char *ptr
p |void |sv_catpvn_mg |SV *sv|const char *ptr|STRLEN len
p |void |sv_catsv_mg |SV *dstr|SV *sstr
-p |void |sv_setpvf_mg |SV *sv|const char* pat|...
+fp |void |sv_setpvf_mg |SV *sv|const char* pat|...
p |void |sv_vsetpvf_mg |SV* sv|const char* pat|va_list* args
p |void |sv_setiv_mg |SV *sv|IV i
p |void |sv_setpviv_mg |SV *sv|IV iv
@@ -1818,7 +1827,7 @@ p |void |sv_usepvn_mg |SV *sv|char *ptr|STRLEN len
p |MGVTBL*|get_vtbl |int vtbl_id
p |char* |pv_display |SV *sv|char *pv|STRLEN cur|STRLEN len \
|STRLEN pvlim
-p |void |dump_indent |I32 level|PerlIO *file|const char* pat|...
+fp |void |dump_indent |I32 level|PerlIO *file|const char* pat|...
p |void |dump_vindent |I32 level|PerlIO *file|const char* pat \
|va_list *args
p |void |do_gv_dump |I32 level|PerlIO *file|char *name|GV *sv