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

Add designated initialiser support to MSVC toolchain #162

Open
skaller opened this issue Dec 17, 2020 · 2 comments
Open

Add designated initialiser support to MSVC toolchain #162

skaller opened this issue Dec 17, 2020 · 2 comments

Comments

@skaller
Copy link
Member

skaller commented Dec 17, 2020

Yeah, one of the primary issues I'm having is that my $HOME\.felix folder (which is C:\Users\ari\.felix) doesn't have a config folder, only a cache folder, so I'm having to wing it in regards to what folder has the configuration files that it's looking for.

In regards to the MSVC error, there's something weird going on in general. If you look a few lines above the error, you'll also see this:

[flx_depchk] C++ Dependency generator FAILED on C:\Users\ari\.felix\cache\text\D\Code\GitHub\felix\src\web\tutopt\sdlgui\gui_01_window_01.cpp

I searched the error earlier and found this. I'm not entirely sure that setting that flag will fix the problem.

Here's part of a response to someone else getting this error:

That said, C++ designated initializers are slightly different than C designated initializers. Designating array elements is not allowed (because the syntax conflicts with lambda declarations), you cannot re-order the initializers from the member declaration order, and you also cannot access nested members in the designator. See https://en.cppreference.com/w/cpp/language/aggregate_initialization#Designated_initializers (the note at the bottom). So, your code will fail to parse in C++20 mode.

According to this, designated initialization was added to Visual Studio 2019 in July, which is after the last time that I built Felix. It seems that a more permanent fix might be necessary for compatibility with VS2019/16.1+.

Originally posted by @arabelladonna in #149 (comment)

@skaller
Copy link
Member Author

skaller commented Dec 17, 2020

So I have added this now, in particular /std:c++latest for C++ and /std:c17 for C in the compiler command line. I have no idea if it works.

@ahribellah
Copy link

This tentatively seems to be working. I successfully built and ran the SDL test that was throwing the error in question and a different test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants