develooper Front page | perl.perl5.porters | Postings from July 2020

Re: Smoke Failures on Alpine Linux

Thread Previous | Thread Next
From:
James E Keenan
Date:
July 30, 2020 18:35
Subject:
Re: Smoke Failures on Alpine Linux
Message ID:
dc29c72a-4db2-2ed9-681b-82cbe411f2f5@pobox.com
On 6/16/20 1:47 PM, Dagfinn Ilmari Mannsåker wrote:
> 
> 
> On 16 June 2020 18:42:00 BST, David Nicol <davidnicol@gmail.com> wrote:
>>> Unfortunately, musl doesn't define a preprocessor symbol
>>> (
>>>
>> https://wiki.musl-libc.org/faq.html#Q:-Why-is-there-no-%3Ccode%3E__MUSL__%3C/code%3E-macro?
>>> ),
>>> so we would have to replace the above preprocessor conditionals with
>> a
>>> Configure check for the actual constness of the field.
>>>
>>> - ilmari
>>>
>>
>> Which, unlike checking preprocessor conditionals, is not a hack.
> 
> Turns out that because of the way struct TM is used, we can make it const regardless of what the system struct tm has.
> 
> This is now smoking on https://github.com/Perl/perl5/commits/smoke-me/ilmari/struct-tm-const-tm_zone, and has been tested successfully on musl with c++.
> 
> - ilmari
> 

Ilmari,

Is the following commit what was intended to solve the problem 
originally reported by Carlos Guevara on June 16?

#####
commit 926c3ce35a7ef910c55cf0964c39718ef5938ca6
Author:     Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>
AuthorDate: Tue Jun 16 13:47:35 2020 +0100
Commit:     Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>
CommitDate: Sat Jul 18 01:28:15 2020 +0100

time64: declare `tm_zone` as `const char*` unconditionally

We only ever assign from `struct tm` to `struct TM`, not the other way
around, so making this const regardless of what `struct tm` has should
be safe.
#####

Thank you very much.
Jim Keenan

Thread Previous | Thread Next


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