Skip to content

C++ MaybeUninit triggers MSVC warning C4582 #913

Open
@CAD97

Description

@CAD97

Specifically,

warning C4582: 'rust::cxxbridge1::MaybeUninit<FVector2D>::value': constructor is not implicitly called

This is a Level 4 warning (/Wall), which is rarely enabled in MSVC projects due to a similar rate of false positive annoyance and questionable advice as clippy::pedantic. Unfortunately, it's enabled as an error in at least one major project (cough Unreal Engine cough) so it's worth avoiding raising this warning.

Given we don't expect the generated code to compile cleanly at level 4, the correct thing to do would be to push the warning state to level 3 and restore the level state afterwards, as described in the MS docs.

#pragma warning( push, 3 )
// Declarations/definitions
#pragma warning( pop )

Some context:

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions