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

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

Thread Previous
From:
Tony Cook via RT
Date:
August 9, 2018 00:44
Subject:
[perl #133422] static assert is failing on windows in PerlIO
Message ID:
rt-4.0.24-18515-1533775431-172.133422-15-0@perl.org
On Fri, 03 Aug 2018 08:43:48 -0700, public@khwilliamson.com wrote:
> 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

The attached fixes it for me.

Tony

---
via perlbug:  queue: perl5 status: new
https://rt.perl.org/Ticket/Display.html?id=133422

Thread Previous


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