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

Fix GCC build warning #89453

Merged
merged 1 commit into from
Mar 13, 2024
Merged

Conversation

adamscott
Copy link
Member

@adamscott adamscott commented Mar 13, 2024

Fixes a GCC warning as error introduced with the merge of #64488.

p_item_a cannot be < 0, as it's a uint32_t.

In file included from ./core/object/object_id.h:34,
                 from ./core/object/message_queue.h:34,
                 from ./core/object/object.h:35,
                 from ./core/variant/binder_common.h:35,
                 from ./core/object/method_bind.h:34,
                 from ./core/object/class_db.h:34,
                 from ./core/object/ref_counted.h:34,
                 from ./core/io/resource_uid.h:34,
                 from ./core/io/resource.h:34,
                 from ./core/io/image.h:34,
                 from ./servers/audio/audio_stream.h:34,
                 from modules/interactive_music/audio_stream_interactive.h:34,
                 from modules/interactive_music/audio_stream_interactive.cpp:31:
modules/interactive_music/audio_stream_interactive.cpp: In member function 'void AudioStreamInteractive::_inspector_array_swap_clip(uint32_t, uint32_t)':
./core/error/error_macros.h:122:32: error: comparison of unsigned expression in '< 0' is always false [-Werror=type-limits]
  122 |         if (unlikely((m_index) < 0 || (m_index) >= (m_size))) {                                                     \
      |                      ~~~~~~~~~~^~~
./core/typedefs.h:277:41: note: in definition of macro 'unlikely'
  277 | #define unlikely(x) __builtin_expect(!!(x), 0)
      |                                         ^
modules/interactive_music/audio_stream_interactive.cpp:356:9: note: in expansion of macro 'ERR_FAIL_INDEX'
  356 |         ERR_FAIL_INDEX(p_item_a, (uint32_t)clip_count);
      |         ^~~~~~~~~~~~~~

@adamscott adamscott added the bug label Mar 13, 2024
@adamscott adamscott added this to the 4.3 milestone Mar 13, 2024
@AThousandShips AThousandShips added topic:buildsystem cherrypick:4.2 Considered for cherry-picking into a future 4.2.x release and removed cherrypick:4.2 Considered for cherry-picking into a future 4.2.x release labels Mar 13, 2024
@akien-mga akien-mga changed the title Fix GCC build failure Fix GCC build warning Mar 13, 2024
@akien-mga akien-mga merged commit 89ba617 into godotengine:master Mar 13, 2024
16 checks passed
@akien-mga
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants