Nim icon indicating copy to clipboard operation
Nim copied to clipboard

fix #17351

Open cooldome opened this issue 4 years ago • 13 comments

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

cooldome avatar Mar 14 '21 22:03 cooldome

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

cooldome avatar Mar 15 '21 00:03 cooldome

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

cooldome avatar Mar 15 '21 11:03 cooldome

Who has permission to upgrade it?

Me. What version of mingw should we ship?

Araq avatar Mar 15 '21 12:03 Araq

The first gcc version that has the necessary feature is 8.0. https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Personal%20Builds/mingw-builds/8.1.0/threads-win32/seh/x86_64-8.1.0-release-win32-seh-rt_v6-rev0.7z/download should work. Let me test it later today.

cooldome avatar Mar 15 '21 12:03 cooldome

nim with gcc v8 had bugs https://github.com/nim-lang/Nim/issues/9375 no idea if there are still any issues. anyways, is there any reason to not update to latest mingw?

nc-x avatar Mar 15 '21 13:03 nc-x

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 avatar Mar 16 '21 13:03 cooldome

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.

cooldome avatar Mar 16 '21 13:03 cooldome

can you please check whether upgrading C compiler would fix these windows-specific bugs affecting math issues https://github.com/nim-lang/Nim/issues/17017?

timotheecour avatar Mar 16 '21 16:03 timotheecour

tested, #17017 is not a problem on mingw 8.1

cooldome avatar Mar 16 '21 18:03 cooldome

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

timotheecour avatar Mar 16 '21 19:03 timotheecour

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?

nc-x avatar Mar 17 '21 03:03 nc-x

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

Araq avatar Mar 30 '21 18:03 Araq

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[bot] avatar Sep 20 '22 18:09 stale[bot]

Succeeded by https://github.com/nim-lang/Nim/pull/20407

ringabout avatar Sep 22 '22 14:09 ringabout