Solaris definition of struct std::lconv
Rainer Orth
ro@CeBiTec.Uni-Bielefeld.DE
Wed Jul 31 12:21:03 GMT 2024
Hi Jonathan,
> I've been working on PR57585 and have added a new
> --enable-clocale=ieee_1003.1-2008
> configure option. That should work on Solaris 11.4 (e.g. cfarm216) but
> some members of the struct std::lconv are missing.
that's excellent news. I'd tried something similar adapting Clement
Chigot's AIX patches to also work on Solaris (unfortunately, I didn't
get very far):
https://inbox.sourceware.org/gcc-patches/20210112152505.GE21410@redhat.com/T/
> In <iso/locale_iso.h> the definition of lconv has:
>
> /*
> * New in IEEE Std 1003.1-2001 for alignment with the ISO/IEC 9899:1999
> * standard. Namespace and binary compatibility dictate that visibility
> * of these new members be limited. Visibility is limited to a strictly
> * conforming ANSI C environment (-Xc) or if _LCONV_C99 is defined.
> */
> #if (defined(_STRICT_STDC) && defined(_STDC_C99)) || defined(_LCONV_C99)
> char int_p_cs_precedes;
> char int_p_sep_by_space;
> char int_n_cs_precedes;
> char int_n_sep_by_space;
> char int_p_sign_posn;
> char int_n_sign_posn;
> #endif
>
> This block is not enabled for C++, but it should be, because C++17
> incorporates the C99 standard library. So the C99 members of lconv
> should be present in C++17 too.
>
> Do you know if this is a known issue?
It is indeed: I encountered it myself in the thread above.
> I can work around it by defining _LCONV_C99 in the relevant .cc files,
> but it shouldn't be needed.
True. Back in early 2021, I filed a bug with Oracle about this
32380020 provide C99 struct lconv members for C++11
but so far not much has come off it. I can certainly ping this again.
However, even if there were a fix tomorrow, libstdc++ would have to cope
with unfixed versions of S11.4 anyway, so I guess the _LCONV_C99 hack is
the way to go for now. We could of course apply a fixincludes fix, but
there's always the risk of the installed and fixed headers diverging.
Rainer
--
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University
More information about the Libstdc++
mailing list