This is the mail archive of the
mailing list for the libstdc++ project.
Re: Re: Another go at max_digits10 and lowest() to numeric_limits for C++-0x
- From: 3dw4rd at verizon dot net
- To: paolo dot carlini at oracle dot com
- Cc: libstdc++ at gcc dot gnu dot org, gdr at integrable-solutions dot net
- Date: Thu, 25 Feb 2010 10:03:42 -0600 (CST)
- Subject: Re: Re: Another go at max_digits10 and lowest() to numeric_limits for C++-0x
Feb 25, 2010 10:25:42 AM, firstname.lastname@example.org wrote:
On 02/25/2010 02:47 PM, email@example.com wrote:
> Here is another go at adding max_digits10 and lowest() to numeric_limits for C++-0x.
> The logic and tests are simpler.
> The definitions for max_digits10 are in src/limits.c
> The config/.../gnu.ver was tweaked after a struggle.
> The patch bootstraps and regtests (including ABI) on x86_64-linux.
Thanks. Looks pretty good to me, I was about to apply it with minor
fixes (eg, __numeric_limits_base::max_digits10 must be also exported
otherwise taking the address of the primary template constant doesn't work).
I have only a doubt, I'd like to ask Gaby about that: when we'll get
constexpr what will happen to the limits exports, in particular the
mangling? Because if something will be different, and I'm afraid it
will, adding more stuff to limits now will just make that work more
difficult, we can as well wait a bit more...
PS: for the immediate needs of
we can use ext/numeric_traits.h
Ah. I remembered to block __numeric_limits_base::max_digits10 out of 3.4 but forgot to add it down in 3.4.14.
I'll upgrade my patch.
As I was struggling with gnu.ver for the first time and looking at another thread about library export issues I was wondering something along these lines:
Instead of struggling with regexen, just list everything. We would obviously want tools to work with this.
If the ABI and mangling are pretty well standardized it seems to me the export list would have to be a pretty fixed target for a given release of C++. It would be a coded microcosm of the standard library really. What happens if you list an export that isn't in the library? I guess you get a warning or an error.
Anyway, say we had export lists for full C++98, and C++0x. These would not be the ones we used, they would be references. Each library impacting DR would have a list of things to add and a list of things to subtract from the list. Each extension would have similar lists. We will have to export some internals I guess.
We could construct a sort of timeline of what stuff to apply at which library version and a tool would take the standard, the DRs, and extensions and belch out an ABI.
Or a tool involving nm could extract the ABI and compare it to the standard - sort of like japitools for C++.
Maybe all this exists already.
I'm just thinking out loud.