On Wed, 31 Jul 2024 at 12:56, Jonathan Wakely <[email protected]> wrote: > > Hi Rainer, > > 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. > > 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? > > I can work around it by defining _LCONV_C99 in the relevant .cc files, > but it shouldn't be needed.
That works, but I already have: #define _POSIX_C_SOURCE 200809L which I would have expected to be enough to enable the block above. POSIX.1-2008 is based on C99, so those members should be defined. I guess the "namespace and binary compatibility" concerns override the conformance requirements here? Since these members only need to be acessed from inside libstdc++.so, not in headers, defining _LCONV_C99 is fine. This seems to be the only build failure I get with the new clocale model on Solaris 11.4, so I'll start testing it.
