fix Issue 19499 - __c_long_double has exact match with double#9117
fix Issue 19499 - __c_long_double has exact match with double#9117dlang-bot merged 1 commit intodlang:masterfrom
Conversation
|
Thanks for your pull request, @WalterBright! Bugzilla references
|
|
Target stable. |
|
This will cause a bootstrap build regression. Without checking, first point of call for changing dmd would be the sinteger_t aliases. So there wouldn't be any implicit D long <-> C long conversions in the first place. Can work backwards from there to find less breaking ways to fix dmd source. |
|
You listed about 4 places in dmd source, why not just insert a cast in those places? |
|
Looks like druntime has mitigated this, so no longer reproducible on Linux (dlang/druntime#2302). But will still fail to build on OSX.
There are explicit casts in all linked places, the kinds of errors I was seeing: Casts would mean adding overrides where implicit It seems odd however that implicit conversion may work on some, but fail on other host systems depending on what druntime bindings are aliasing today. |
|
@ibuclaw I don't really understand your comment. What I need is can you fix the dmd code to fix the bootstrap errors you're seeing? Can you submit a PR for that? |
|
The bootstrap errors are no longer reproducible since druntime changed aliases of int64_t and uint64_t in dlang/druntime#2302. |
|
The bootstrap errors are in places where there's already appropriate casting. The errors are local to the longdouble implementation which only has overrides for int64_t/uint64_t, not long/ulong. What I posted is what adding long and ulong overrides would look like in gdc's longdouble. Which just looks silly. |
|
It doesn't matter if it looks silly in the dmd source code. What does matter is adding an "exact" match of |
|
Well I am not happy that conversely, having This isn't just compiling dmd itself, but anyone interfacing with a C++ library that uses |
This issue affects C++ as well, because it affects C++ name mangling. Different integer types with the same size can have different mangling. D code should use core.stdc.stdint's definitions of int64_t and uint64_t to match the C++ mangling. |
|
Well it's no good if getting the correct C++ mangling means making code that uses it uncompilable. It is not ambiguous here as to which overload should be called. if the special enum types don't solve this, then there is no point to having them in the first place. |
This reverts #8632 which was an attempt to fix https://issues.dlang.org/show_bug.cgi?id=19201 but dmd source code should be fixed instead of changing the language semantics.