diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2014-06-18 11:10:22 -0400 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2014-06-18 14:15:37 -0400 |
commit | 46f0524960d2a80b138741b95930e4aa1ffa15c4 (patch) | |
tree | 4ae22405161a4cc8e4d64bc7edb719c112a6e430 /perlio.c | |
parent | 57d4b8c5bc14bfcf2f6d0c4e04fa483734c339d5 (diff) | |
download | perl-46f0524960d2a80b138741b95930e4aa1ffa15c4.tar.gz |
Try silencing the infamous PerlSIO_set_ptr in perlio.c.
Diffstat (limited to 'perlio.c')
-rw-r--r-- | perlio.c | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -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 |