Skip to content

ignore maybe-initialized warning in map_caster::convert_elements field conv#6030

Open
alan-rager-skydio wants to merge 2 commits intopybind:masterfrom
alan-rager-skydio:ignore-maybe-initialized-convert_elements
Open

ignore maybe-initialized warning in map_caster::convert_elements field conv#6030
alan-rager-skydio wants to merge 2 commits intopybind:masterfrom
alan-rager-skydio:ignore-maybe-initialized-convert_elements

Conversation

@alan-rager-skydio
Copy link
Copy Markdown

In map_caster::convert_elements, conv is initialized with a call to ::load, and GCC 13 sees that as a maybe-uninitialized error to call it later:

for (const auto &it : seq) {
    value_conv conv;              // line 332: declared, "uninitialized"
    if (!conv.load(it, convert)) { // line 333: conv.load() initializes conv's internal state
        return false;
    }
    value.push_back(cast_op<Value &&>(std::move(conv)));  // line 336: uses conv
}

By adding ignores around this area, we can avoid the compilation failure.

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

Successfully merging this pull request may close these issues.

1 participant