Skip to content

Commit 21f9e67

Browse files
committed
Fixed a -Wstrict-aliasing warning from old gcc:
src/SDL_mixer_metadata_tags.c: In function 'get_musicmatch_len': src/SDL_mixer_metadata_tags.c:873: warning: dereferencing type-punned pointer will break strict-aliasing rules
1 parent cf4befd commit 21f9e67

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/SDL_mixer_metadata_tags.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -868,9 +868,9 @@ static Sint64 get_musicmatch_len(SDL_IOStream *io)
868868
// unused section: (4 bytes of 0x00)
869869
if (SDL_SeekIO(io, -(len + 4), SDL_IO_SEEK_END) == -1) {
870870
return -1;
871-
} else if (SDL_ReadIO(io, buf, 4) != 4) {
871+
} else if (SDL_ReadIO(io, &j, 4) != 4) {
872872
return -1;
873-
} else if (*((Uint32 *) buf) != 0) {
873+
} else if (j != 0) {
874874
return -1;
875875
}
876876
#endif

0 commit comments

Comments
 (0)