x2p/str.c C++ clean-up.
authorCraig A. Berry <craigberry@mac.com>
Sun, 15 Jul 2012 21:18:42 +0000 (16:18 -0500)
committerCraig A. Berry <craigberry@mac.com>
Tue, 31 Jul 2012 23:42:41 +0000 (18:42 -0500)
commitcfb8f080895a44c06733a04064300a07f255aeb0
tree1b946c51a40c5f99942ced4b5157cce4c4988c00
parent40b6423cb7af5e5b76038bef524e04a65967825a
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.
x2p/str.c