-
Notifications
You must be signed in to change notification settings - Fork 28
cmath: Restore definitions of std::fpclassify #42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This partially reverts 5a4c53d and adds the constants needed for it to work. Fixes: modm-io#40
Hi @jwakely thanks for this. I tried your changes locally, and they do work. I used There are some other goodies in my branch you might like to integrate into this one (or alternately) I could integrate your more proper In my branch, I also
So you will want those changes too. Or if you prefer, i could merge your changes into my branch manually (which I've done locally). It's your choice. Cc: @chris-durand and @salkinium |
Hi @jwakely I would also like to discuss a further point with you regarding the constants such as These should come out of There would be several other options. Let's say, however, that a client had previously worked around the missing constants earlier and did a #define FP_ZERO 42 or something local like that. Then we would accept the definition. Do you think it makes sense to warn or error out in such cases or simply Thoughts? Cc: @chris-durand and @salkinium |
Hi @jwakely I fumbled around with some local, manual merges, but ended up bringing your corrected changes into #41. We can either continue there or continue with yours. Anyway in my #41, you'll find the latest greatest |
Let's close this and continue with #41. I only created this one because it seemed clearer to show a real diff rather than just explaining what I meant.
I don't think it is really a problem to use "wrong" definitions provided by the user, as long as they are defined sensibly, as required by the C standard, i.e.
If the user has provided those macros and they meet that requirement, then it would be fine to use them. The definition of If the user has defined them so the values are not distinct, or are not integer constants, then the user gets what they deserve. I don't think that's your problem and you shouldn't need to handle that or try to make There could potentially be a problem if the user has only defined a subset of those macros, maybe because they only cared about If you care about that possibility, you could use a check that none of them is defined before defining your versions:
This way you don't conflict with values provided by the user, but they'll get an error in the definition of
That should prompt the user to either define all of them, or stop defining any of them, so that they come from your new
|
This partially reverts 5a4c53d and adds the constants needed for it to work.
Fixes: #40