summaryrefslogtreecommitdiff
path: root/perlio.c
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2014-06-18 11:10:22 -0400
committerJarkko Hietaniemi <jhi@iki.fi>2014-06-18 14:15:37 -0400
commit46f0524960d2a80b138741b95930e4aa1ffa15c4 (patch)
tree4ae22405161a4cc8e4d64bc7edb719c112a6e430 /perlio.c
parent57d4b8c5bc14bfcf2f6d0c4e04fa483734c339d5 (diff)
downloadperl-46f0524960d2a80b138741b95930e4aa1ffa15c4.tar.gz
Try silencing the infamous PerlSIO_set_ptr in perlio.c.
Diffstat (limited to 'perlio.c')
-rw-r--r--perlio.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/perlio.c b/perlio.c
index d41c2f54e8..730a73cf9b 100644
--- a/perlio.c
+++ b/perlio.c
@@ -3535,7 +3535,20 @@ PerlIOStdio_set_ptrcnt(pTHX_ PerlIO *f, STDCHAR * ptr, SSize_t cnt)
FILE * const stdio = PerlIOSelf(f, PerlIOStdio)->stdio;
if (ptr != NULL) {
#ifdef STDIO_PTR_LVALUE
+ /* This is a long-standing infamous mess. The root of the
+ * problem is that one cannot know the signedness of char, and
+ * more precisely the signedness of FILE._ptr. The following
+ * things have been tried, and they have all failed (across
+ * different compilers (remember that core needs to to build
+ * also with c++) and compiler options:
+ *
+ * - casting the RHS to (void*) -- works in *some* places
+ * - casting the LHS to (void*) -- totally unportable
+ *
+ * So let's try silencing the warning at least for gcc. */
+ GCC_DIAG_IGNORE(-Wpointer-sign);
PerlSIO_set_ptr(stdio, ptr); /* LHS STDCHAR* cast non-portable */
+ GCC_DIAG_RESTORE;
#ifdef STDIO_PTR_LVAL_SETS_CNT
assert(PerlSIO_get_cnt(stdio) == (cnt));
#endif