Skip to content

The return value of RenderTexture::create is being ignored #190

@vittorioromeo

Description

@vittorioromeo

This warning is produced when compiling the latest version of imgui-sfml:

imgui-SFML.cpp: In function 'void ImGui::SFML::UpdateFontTexture()':
imgui-SFML.cpp:584:19: warning: ignoring return value of 
    'bool sf::Texture::create(unsigned int, unsigned int)', declared with attribute 'nodiscard' [-Wunused-result]

  584 |     texture.create(width, height);
      |     ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~

We would need to react on failure, possibly by printing some sort of error message to the console, or by propagating a return value up the stack to the caller of Init.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions