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

Re: Smoke Failures on Alpine Linux

Thread Previous | Thread Next
June 16, 2020 09:54
Re: Smoke Failures on Alpine Linux
Message ID:
Carlos Guevara <> writes:

> I recently started smoke testing Alpine Linux, and it appears that all
> builds using g++ are failing early in 'make'.  For example:
> I suspect it has something to do with the fact that Alpine uses musl
> instead of glibc:

Yes, this is the error messsage:

time64.c: In function 'void S_copy_little_tm_to_big_TM(const tm*, TM64*)':
time64.c:317:32: error: invalid conversion from 'const char*' to 'char*' [-fpermissive]
  317 |     dest->tm_zone       = src->tm_zone;
      |                           ~~~~~^~~~~~~
      |                                |
      |                                const char*

Which stems from the the fact that musl's time.h defines struct tm's
tm_zone as const char*, while time64.h only defines it as const on
glibc, QNX, Cygwin and Android (except under C++):

/* If glibc is defined or we are on QNX, use const.
 * Otherwise, if we are on android, use const but
 * not with g++.
#  if defined(__GLIBC__) || (defined(__ANDROID__) && !defined(__cplusplus)) \
    || defined(__QNX__) || defined(__CYGWIN__)
#  endif
        char    *tm_zone;

This compiles (with a warning) under C, but is not allowed under C++
(which nobody appears to have tried on musl before).

Unfortunately, musl doesn't define a preprocessor symbol
so we would have to replace the above preprocessor conditionals with a
Configure check for the actual constness of the field.

- ilmari
"A disappointingly low fraction of the human race is,
 at any given time, on fire." - Stig Sandbeck Mathisen

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About