develooper Front page | perl.perl5.porters | Postings from August 2018

[perl #133422] static assert is failing on windows in PerlIO

From:
karl williamson
Date:
August 3, 2018 15:44
Subject:
[perl #133422] static assert is failing on windows in PerlIO
Message ID:
rt-4.0.24-26521-1533311029-420.133422-75-0@perl.org
# New Ticket Created by  karl williamson 
# Please include the string:  [perl #133422]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/Ticket/Display.html?id=133422 >


This is a bug report for perl from khw@khw-xps-8930.(none),
generated with the help of perlbug 1.41 running under perl 5.29.2.


-----------------------------------------------------------------
In, for example, http://perl5.test-smoke.org/report/68458, we are getting

scalar.xs: In function 'PerlIOScalar_read':
   ..\..\lib\CORE/perl.h:3430:36: error: static assertion failed: 
"sizeof(long) >= sizeof(len)"
   ..\..\lib\CORE/perl.h:3446:52: note: in expansion of macro 
'STATIC_ASSERT_DECL'
   scalar.xs:189:9: note: in expansion of macro 'STATIC_ASSERT_STMT'

The code in scalar.xs, is

	/* I assume that Off_t is at least as large as len (which
	 * seems safe) and that the size of the buffer in our SV is
	 * always less than half the size of the address space
	 */
	STATIC_ASSERT_STMT(sizeof(Off_t) >= sizeof(len));
	assert(len < ((~(STRLEN)0) >> 1));

all quoted lines are from

commit 63d073d27fe50d823f0e3c528ac62c9aa584704d
  Author: Tony Cook <tony@develop-help.com>
  Date:	 Wed Dec 17 13:32:43 2014 +1100

      [perl #123443] avoid overflowing got into a negative number



---
Flags:
     category=library
     severity=high
     module=PerlIO
---
Site configuration information for perl 5.29.2




nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About