[PATCH] libstdc++: implement locale support for AIX

Rainer Orth ro@CeBiTec.Uni-Bielefeld.DE
Tue Jan 12 16:00:29 GMT 2021


Hi Clement,

> I've reworked the patch to merged dragonfly and AIX
> models into the new one named "ieee_1003.1-2008". 
> It seems okay on the AIX part but if someone can test
> on Dragonfly and Freebsd I would be glad. Configure 
> needs to be regenerated, first.
>
> For now, I've used #ifdef inside the code for the few
> differences. There are less than I thought. So, it seems 
> okay to me. 

TBH, I find this liberal sprinkling of target-specific #ifdefs over the
code horrible: it's completely out of style with GCC conventions.  This
is exactly what autoconf is for: test for the existance of headers and
functions like strtof_l and act accordingly.  If in the future other
OSes will make use of the code, most differences will already be handled
and it's way easier to understand defined(HAVE_STRTOF_L) than
defined(_AIX) || defined(HP_UX).  From your code one simply cannot tell
why some code is used on AIX while something else on (say) DragonflyBSD.
It gets even worse when (as does happen) standard support differs
between versions: expressing this with platform ifdefs is nothing short
of a nightmare.

	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University


More information about the Gcc-patches mailing list