فهرست منبع

stb_sprintf: avoid clang -O3 misaligned access

Sean Barrett 5 سال پیش
والد
کامیت
a2c91804a3
1فایلهای تغییر یافته به همراه1 افزوده شده و 1 حذف شده
  1. 1 1
      stb_sprintf.h

+ 1 - 1
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;