ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> perl5-porters
perl5-porters
Re: MacOS X Issues
by Nicholas Clark other posts by this author
Jan 30 2002 6:47PM messages near this date
Re: MacOS X Issues | Re: MacOS X Issues
On Wed, Jan 30, 2002 at 08:24:11PM +0200, Jarkko Hietaniemi wrote:
>  On Wed, Jan 30, 2002 at 04:02:01PM +0100, Arthur Bergman wrote:

>  > 2) libs/warning
>  > error with regard to files opened in a certain mode, should we skip this test since we k
now it is failing?
>  
>  I never understood why are we still getting this error-- I thought
>  it was bound to broken/different implementation of *stdio* in certain
>  platforms, and now in the shiny new era of perlio...?  Nick?

You were meaning Nick I-S, but I'll express an opinion
>  In case someone is wondering, this the pp_hot warning:


>  ########
>  # pp_hot.c [pp_print]
              ^^^^^^^^
we're testing this code with the prints to STDIN, and something completely
different with the <> 

>  use warnings 'io' ;
>  print STDIN "anc";
>  print <STDOUT>;
>  print <STDERR>;
>  open(FOO, ">&STDOUT") and print <FOO>;
>  print getc(STDERR);
>  print getc(FOO);

code which has no references to STD anything

>  ####################################################################
>  # The next test is known to fail on some systems (Linux+old glibc, #
>  # some *BSDs (including Mac OS X and NeXT), among others.          #
>  # We skip it for now (on the grounds that it is "just" a warning). #
>  ####################################################################
>  #read(FOO,$_,1);
>  no warnings 'io' ;
>  print STDIN "anc";
>  EXPECT
>  Filehandle STDIN opened only for input at - line 3.
>  Filehandle STDOUT opened only for output at - line 4.
>  Filehandle STDERR opened only for output at - line 5.
>  Filehandle FOO opened only for output at - line 6.
>  Filehandle STDERR opened only for output at - line 7.
>  Filehandle FOO opened only for output at - line 8.

And it transpires that STDOUT is read/write on FreeBSD (and maybe some other
places) so the code as written is an unintended bit of non-portability.

I vote that we re-write it to open a temporary file for input, and then
try to print to that, and remove all reference to STDIN.
Split out the <>  reading tests to another test, which I think is for
do_readline (which is actually in pp_hot.c)

If this is not thought to be a bad way I'll write a patch.
And "live dangerously" and reinstate the skipped read which I believe is
due to expecting STDOUT to be write only.

Nicholas Clark
-- 
EMCFT http://www.ccl4.org/~nick/CV.html
Thread:
Arthur Bergman
Jarkko Hietaniemi
Arthur Bergman
Nicholas Clark
Nick Ing-Simmons
Arthur Bergman
Jarkko Hietaniemi
H.Merijn Brand

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved