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

msvc builds cause warning c4530 #1297

Closed
Repiteo opened this issue Nov 3, 2023 · 3 comments · Fixed by #1303
Closed

msvc builds cause warning c4530 #1297

Repiteo opened this issue Nov 3, 2023 · 3 comments · Fixed by #1303
Labels
bug This has been identified as a bug platform:windows topic:buildsystem Related to the buildsystem or CI setup
Milestone

Comments

@Repiteo
Copy link
Contributor

Repiteo commented Nov 3, 2023

Godot version

v4.2.beta.custom_build [5ee983188]

godot-cpp version

c1196a1

System information

Windows 11

Issue description

Recently, my godot-cpp builds have had their logs absolutely FLOODED with this message en-masse:

C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.37.32822\include\vector(1612): warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.37.32822\include\vector(1601): note: while compiling class template member function 'void std::vector<GDExtensionClassMethodArgumentMetadata,std::allocator<GDExtensionClassMethodArgumentMetadata>>::_Reallocate_exactly(const unsigned __int64)'
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.37.32822\include\vector(1685): note: see the first reference to 'std::vector<GDExtensionClassMethodArgumentMetadata,std::allocator<GDExtensionClassMethodArgumentMetadata>>::_Reallocate_exactly' in 'std::vector<GDExtensionClassMethodArgumentMetadata,std::allocator<GDExtensionClassMethodArgumentMetadata>>::reserve'
D:\Godot\godot-libusb\godot-cpp\include\godot_cpp/core/method_bind.hpp(134): note: see the first reference to 'std::vector<GDExtensionClassMethodArgumentMetadata,std::allocator<GDExtensionClassMethodArgumentMetadata>>::reserve' in 'godot::MethodBind::get_arguments_metadata_list'
D:\Godot\godot-libusb\godot-cpp\include\godot_cpp/core/method_bind.hpp(131): note: see reference to class template instantiation 'std::vector<GDExtensionClassMethodArgumentMetadata,std::allocator<GDExtensionClassMethodArgumentMetadata>>' being compiled

I haven't been actively building a gdextension up until this past week or so, so I can't speak for how long this has potentially been in place. The last time I was actively building was late July, and it wasn't present at that time

Steps to reproduce

  1. build with msvc
  2. cry

Minimal reproduction project

N/A

@dsnopek
Copy link
Collaborator

dsnopek commented Nov 3, 2023

Hm, this sounds like it's related to PR #1216 which disabled exceptions by default. We do use STL a bit in godot-cpp - I wonder if that means exceptions need to be enabled?

Do you still get the error when you build with scons disable_exceptions=no?

@Repiteo
Copy link
Contributor Author

Repiteo commented Nov 5, 2023

I tried building with that & the warning still appeared

@Repiteo
Copy link
Contributor Author

Repiteo commented Nov 5, 2023

Wait, I figured it out! The is_msvc define wasn't working because the order was out of wack! We never realized this because it was using the problematic env.get("is_msvc", False): syntax instead of ensuring a valid value ahead of time and then using env[is_msvc]. This is the same issue that I was already addressing in another PR, but I never expanded it to is_msvc there; I'll do that now and link it after!

@akien-mga akien-mga added bug This has been identified as a bug platform:windows topic:buildsystem Related to the buildsystem or CI setup labels Nov 9, 2023
@akien-mga akien-mga added this to the 4.2 milestone Nov 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This has been identified as a bug platform:windows topic:buildsystem Related to the buildsystem or CI setup
Projects
None yet
3 participants