diff options
Diffstat (limited to 'pod')
-rw-r--r-- | pod/perlhack.pod | 14 | ||||
-rw-r--r-- | pod/perltodo.pod | 18 |
2 files changed, 18 insertions, 14 deletions
diff --git a/pod/perlhack.pod b/pod/perlhack.pod index a2c989eeaf..e0a9807ddf 100644 --- a/pod/perlhack.pod +++ b/pod/perlhack.pod @@ -2461,6 +2461,10 @@ reading. Please test your changes with as many C compilers and platforms as possible -- we will, anyway, and it's nice to save oneself from public embarrassment. +If using gcc, starting from Perl 5.9.4 Perl core C files will be +compiled with the C<-std=c89> option which will hopefully catch +most of these unportabilities. + Also study L<perlport> carefully to avoid any bad assumptions about the operating system, filesystem, and so forth. @@ -2771,13 +2775,11 @@ Or we will publicly ridicule you. Seriously. =item * -Do not use strcpy() or strcat() +Do not use strcpy() or strcat() or strncpy() or strncat() -While some uses of these still linger in the Perl source code, -we have inspected them for safety and are very, very ashamed of them, -and plan to get rid of them. Use my_strlcpy() and my_strlcat() instead: -they either use the native implementation, or Perl's own implementation -(borrowed from the public domain implementation of INN). +Use my_strlcpy() and my_strlcat() instead: they either use the native +implementation, or Perl's own implementation (borrowed from the public +domain implementation of INN). =item * diff --git a/pod/perltodo.pod b/pod/perltodo.pod index a675b7a77e..6bf9d1f4cb 100644 --- a/pod/perltodo.pod +++ b/pod/perltodo.pod @@ -163,11 +163,6 @@ when is duplicated in F<makedef.pl>. Writing things twice is bad, m'kay. It would be good to teach C<embed.pl> to understand the conditional compilation, and hence remove the duplication, and the mistakes it has caused. - - - - - =head1 Tasks that need a little sysadmin-type knowledge Or if you prefer, tasks that you would learn from, and broaden your skills @@ -308,10 +303,10 @@ arranges for building C<miniperl> for TARGET machine, so this C<miniperl> is assumed then to be copied to TARGET machine and used as a replacement of full C<perl> executable. -This should be done litle differently. Namely C<miniperl> should be built for +This could be done little differently. Namely C<miniperl> should be built for HOST and then full C<perl> with extensions should be compiled for TARGET. - - +This, however, might require extra trickery for %Config: we have one config +first for HOST and then another for TARGET. =head1 Tasks that need a little C knowledge @@ -493,9 +488,16 @@ system() accepts a LIST syntax (and a PROGRAM LIST syntax) to avoid running a shell. readpipe() (the function behind qx//) could be similarly extended. +=head2 strcat(), strcpy(), strncat(), strncpy(), sprintf(), vsprintf() +Maybe create a utility that checks after each libperl.a creation that +none of the above (nor sprintf(), vsprintf(), or *SHUDDER* gets()) +ever creep back to libperl.a. + nm libperl.a | ./miniperl -alne '$o = $F[0] if /:$/; print "$o $F[1]" if $F[0] eq "U" && $F[1] =~ /^(?:strn?c(?:at|py)|v?sprintf|gets)$/' +Note, of course, that this will only tell whether B<your> platform +is using those naughty interfaces. =head1 Tasks that need a knowledge of the interpreter |