In perl.git, the branch blead has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/cfb8f080895a44c06733a04064300a07f255aeb0?hp=40b6423cb7af5e5b76038bef524e04a65967825a>

- Log -----------------------------------------------------------------
commit cfb8f080895a44c06733a04064300a07f255aeb0
Author: Craig A. Berry <[email protected]>
Date:   Sun Jul 15 16:18:42 2012 -0500

    x2p/str.c C++ clean-up.
    
    Compiling str.c with HP C++ for OpenVMS says,
    
            FILE_ptr(fp) = (void*)ptr; /* LHS STDCHAR* cast non-portable */
    .....................^
    %CXX-E-INCASSOPN, a value of type "void *" cannot be assigned to an
              entity of type "char *"
    at line number 213 in file D0:[craig.blead.x2p]str.c;1
    
        FILE_ptr(fp) = (void*)ptr; /* LHS STDCHAR* cast non-portable */
    .................^
    %CXX-E-INCASSOPN, a value of type "void *" cannot be assigned to an
              entity of type "char *"
    at line number 233 in file D0:[craig.blead.x2p]str.c;1
    
    So remove the void casts to avoid the errors.  This is an exact
    mirror of d06fc7d4ca98, which also removed the void cast from an
    equivalent line in perlio.c.  That was almost six years ago, so if
    anything especially dire were going to happen without the cast, it
    likely would have happened by now.
    
    The casts were added by cc00df79d5 and 5faea5d5, the former of which
    refers vaguely to "compiler worries" without specifying what they
    were, but signedness warnings are a likely suspect.  We'll get those
    again now, but warnings are less bad than errors.  A more robust
    solution would be to add a Configure-time detection of the type of
    FILE._ptr and cast everything to that.
    
    An even more robust solution would be to eliminate all the "buffer
    snooping" mechanisms and concede that maintaining an stdio
    implementation is a job for stdio maintainers and not Perl
    maintainers.
-----------------------------------------------------------------------

Summary of changes:
 x2p/str.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/x2p/str.c b/x2p/str.c
index 58798c0..d54d088 100644
--- a/x2p/str.c
+++ b/x2p/str.c
@@ -210,7 +210,7 @@ str_gets(register STR *str, register FILE *fp)
        }
        
        FILE_cnt(fp) = cnt;             /* deregisterize cnt and ptr */
-       FILE_ptr(fp) = (void*)ptr; /* LHS STDCHAR* cast non-portable */
+       FILE_ptr(fp) = ptr;
        i = getc(fp);           /* get more characters */
        cnt = FILE_cnt(fp);
        ptr = (STDCHAR*)FILE_ptr(fp);           /* reregisterize cnt and ptr */
@@ -230,7 +230,7 @@ str_gets(register STR *str, register FILE *fp)
 
 thats_all_folks:
     FILE_cnt(fp) = cnt;                        /* put these back or we're in 
trouble */
-    FILE_ptr(fp) = (void*)ptr; /* LHS STDCHAR* cast non-portable */
+    FILE_ptr(fp) = ptr;
     *bp = '\0';
     str->str_cur = bp - str->str_ptr;  /* set length */
 

--
Perl5 Master Repository

Reply via email to