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

g++-12 warnings in **release** builds #869

Open
Mrkol opened this issue Aug 26, 2024 · 0 comments
Open

g++-12 warnings in **release** builds #869

Mrkol opened this issue Aug 26, 2024 · 0 comments

Comments

@Mrkol
Copy link

Mrkol commented Aug 26, 2024

When doing a release build, g++-12.3.0 (and g++-13.2.0 too) emits a warning inside of Tracy's sources:

In file included from .../public/TracyClient.cpp:25:
.../public/client/TracySysPower.cpp: In member function ‘void tracy::SysPower::ScanDirectory(const char*, int)’:
.../public/client/TracySysPower.cpp:88:27: warning: ignoring return value of ‘int fscanf(FILE*, const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   88 |                     fscanf( f, "%" PRIu64, &maxRange );
      |                     ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~

And as far as I can tell, that entire neighborhood of code completely ignores error code return values, which isn't great, generally speaking, so I think this can and should be fixed.

Furthermore, a (seemingly false-positive) warning gets emitted in Tracy's headers, which for some reason I cannot suppress even with system includes:

In member function ‘uint8_t tracy::VkCtx::GetId() const’,
    inlined from ‘tracy::VkCtxScope::~VkCtxScope()’ at .../public/tracy/TracyVulkan.hpp:620:58,
    inlined from ‘void Renderer::drawFrame()’ at /home/runner/work/graphics-course/graphics-course/tasks/model_bakery/renderer/Renderer.cpp:130:5:
.../public/tracy/TracyVulkan.hpp:341:16: error: ‘___tracy_gpu_zone.tracy::VkCtxScope::m_ctx’ may be used uninitialized [-Werror=maybe-uninitialized]
  341 |         return m_context;
      |                ^~~~~~~~~

I'm not too sure about this one, maybe it should simply be suppressed via gcc-specific pragmas?

And yeah I have no idea why this only happens in release builds.

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

1 participant