Skip to content
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

fix #17351 #17375

Closed
wants to merge 1 commit into from
Closed

fix #17351 #17375

wants to merge 1 commit into from

Conversation

cooldome
Copy link
Member

@cooldome cooldome commented Mar 14, 2021

fix #17351. Initialization of parent struct in C++ appeared only in C++17.
https://stackoverflow.com/questions/47333843/using-initializer-list-for-a-struct-with-inheritance

@@ -14,3 +14,13 @@ block: # issue #13071
a = e.msg & $e.name # was segfaulting here for `nim cpp --gc:arc`
doAssert a == "foo:MyExcept"
fun()


block: # issue #17351
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
block: # issue #17351
block: # bug #17351

https://nim-lang.github.io/Nim/contributing.html

Always refer to a GitHub issue using the following exact syntax: bug #1234 as shown above, so that it's consistent and easier to search or for tooling. Some browser extensions [...]


block: # issue #17351
type
Foo {.inheritable.} = object
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wrong file (texceptions.nim): this isn't related to exceptions nor to arc; instead put it in for eg:
tests/misc/t17351.nim
with:

discard """
  targets: "c cpp"
"""

(and optionally with matrix "--gc:arc; --gc:refc")

@@ -113,7 +113,7 @@ compiler nintendoSwitchGCC:
asmStmtFrmt: "asm($1);$n",
structStmtFmt: "$1 $3 $2 ", # struct|union [packed] $name
produceAsm: gnuAsmListing,
cppXsupport: "-std=gnu++14 -funsigned-char",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang is also affected by this

@cooldome
Copy link
Member Author

Looks like CI is using gcc 5.5 which doesn't support required C++ feature.
The best option is to upgrade the CI

@cooldome
Copy link
Member Author

If I got it correctly mingw is taken from nim website https://nim-lang.org/download/mingw64.7z.
Who has permission to upgrade it?

@Araq
Copy link
Member

Araq commented Mar 15, 2021

Who has permission to upgrade it?

Me. What version of mingw should we ship?

@cooldome
Copy link
Member Author

cooldome commented Mar 15, 2021

@nc-x
Copy link
Contributor

nc-x commented Mar 15, 2021

nim with gcc v8 had bugs #9375
no idea if there are still any issues.
anyways, is there any reason to not update to latest mingw?

@cooldome
Copy link
Member Author

I have tried gcc 8.1 I have proposed above and I haven't experienced any issues, checked for issues mentioned in #9375 as well. I think it is ok to upgrade.

@cooldome
Copy link
Member Author

cooldome commented Mar 16, 2021

If there si objection to gcc 8.1 there is tdm-gcc 9.2 https://jmeubank.github.io/tdm-gcc/articles/2020-03/9.2.0-release. I also had good experience with it but it comes with installer.

@timotheecour
Copy link
Member

can you please check whether upgrading C compiler would fix these windows-specific bugs affecting math issues #17017?

@cooldome
Copy link
Member Author

tested, #17017 is not a problem on mingw 8.1

@timotheecour
Copy link
Member

timotheecour commented Mar 16, 2021

tested, #17017 is not a problem on mingw 8.1

great, just to clarify, what's the output you get for:

import math

func c_frexp2(x: cdouble, exponent: var cint): cdouble {.
    importc: "frexp", header: "<math.h>".}

var x = cdouble(-0.0)
var exponent: cint

echo c_frexp2(x, exponent)
echo sqrt(-1.0)
echo gamma(-1.0)

?

it should be:

-0.0
nan
nan

@nc-x
Copy link
Contributor

nc-x commented Mar 17, 2021

Even if nim-lang.org/download/mingw64.7z is updated, most people won't get to know that a newer gcc is required for some bug fixes.
is the mingw download integrated into choosenim, so that when the nim version is upgraded, newer mingw will be downloaded as well?

@Araq
Copy link
Member

Araq commented Mar 30, 2021

The MingW we ship with Nim has been updated. The next release will have it.

Copy link
Member

@ringabout ringabout left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please solve the comments

@stale
Copy link

stale bot commented Sep 20, 2022

This pull request has been automatically marked as stale because it has not had recent activity. If you think it is still a valid PR, please rebase it on the latest devel; otherwise it will be closed. Thank you for your contributions.

@stale stale bot added the stale Staled PR/issues; remove the label after fixing them label Sep 20, 2022
@ringabout ringabout closed this Sep 22, 2022
@ringabout
Copy link
Member

Succeeded by #20407

@ringabout ringabout deleted the fix_17351 branch September 22, 2022 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale Staled PR/issues; remove the label after fixing them
Projects
None yet
Development

Successfully merging this pull request may close these issues.

C++ backend fails when put inherited object in another object type
5 participants