From a2c91804a3c9876879997c30c43d73e2dd42dfc0 Mon Sep 17 00:00:00 2001 From: Sean Barrett Date: Thu, 6 Feb 2020 05:36:53 -0800 Subject: [PATCH] stb_sprintf: avoid clang -O3 misaligned access --- stb_sprintf.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stb_sprintf.h b/stb_sprintf.h index ae61bdc..fe4d773 100644 --- a/stb_sprintf.h +++ b/stb_sprintf.h @@ -1229,7 +1229,7 @@ STBSP__PUBLICDEF int STB_SPRINTF_DECORATE(vsprintfcb)(STBSP_SPRINTFCB *callback, stbsp__cb_buf_clamp(i, n); n -= i; STBSP__UNALIGNED(while (i >= 4) { - *(stbsp__uint32 *)bf = *(stbsp__uint32 *)s; + *(stbsp__uint32 volatile *)bf = *(stbsp__uint32 volatile *)s; bf += 4; s += 4; i -= 4;