| Summary: | fix strict aliasing warnings in SDL_test_fuzzer.c | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Ozkan Sezer <sezeroz> |
| Component: | *don't know* | Assignee: | Ryan C. Gordon <icculus> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | ||
| Version: | HG 2.0 | ||
| Hardware: | x86 | ||
| OS: | Linux | ||
| Attachments: | SDL_test_fuzzer.c strict aliasing patch | ||
Added, thanks! https://hg.libsdl.org/SDL/rev/732b6ef4aae7 |
Created attachment 3181 [details] SDL_test_fuzzer.c strict aliasing patch I always get the following warnings from SDL_test_fuzzer.c: src/test/SDL_test_fuzzer.c: In function 'SDLTest_RandomUint64': src/test/SDL_test_fuzzer.c:130: warning: likely type-punning may break strict-aliasing rules: object '*vp' of main type 'unsigned int' is referenced at or around src/test/SDL_test_fuzzer.c:134 and may be aliased to object 'value' of main type 'long long unsigned int' which is referenced at or around src/test/SDL_test_fuzzer.c:129. src/test/SDL_test_fuzzer.c:135: warning: likely type-punning may break strict-aliasing rules: object '*{unknown}' of main type 'unsigned int' is referenced at or around src/test/SDL_test_fuzzer.c:135 and may be aliased to object 'value' of main type 'long long unsigned int' which is referenced at or around src/test/SDL_test_fuzzer.c:129. The attached patch fixes it by using a union instead of type-punning.