Skip to content

Fixed warning: calloc-transposed-args #714

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

Merged
merged 1 commit into from
Jul 26, 2025

Conversation

Sackzement
Copy link
Contributor

[ 61%] Building C object CMakeFiles/SDL3_mixer-shared.dir/src/decoder_wav.c.o
/path/to/SDL_mixer/src/decoder_wav.c: In functionWAV_init_track’:
/path/to/SDL_mixer/src/decoder_wav.c:1384:58: warning: ‘SDL_callocsizes specified withsizeofin the earlier argument and not in the later argument [-Wcalloc-transposed-args]
 1384 |         state->output.data = (Sint16 *)SDL_calloc(sizeof(Sint16), state->output.size);
      |                                                          ^~~~~~
/path/to/SDL_mixer/src/decoder_wav.c:1384:58: note: earlier argument should specify number of elements, later size of each element

Swapping the arguments gets rid of the warning.

@slouken slouken merged commit 8e6765e into libsdl-org:main Jul 26, 2025
5 checks passed
@slouken
Copy link
Collaborator

slouken commented Jul 26, 2025

Merged, thanks!

@Sackzement Sackzement deleted the calloc-warning branch July 26, 2025 15:20
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.

2 participants