Skip to content
Myr

stb_sprintf: redo ASAN fixes after problematic merge

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Sean Barrett · committed by Sean Barrett · parent e802821 · Browse files · 1 file+21 added−8 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+21 added−8 removed

  • other:+21 added−8 removed

1 file+21 added−8 removed

modified:stb_sprintf.h+21 added-8 removed
138 unmodified lines
139"%s%s%s" for 64 char strings (7.1x/7.3x faster)140"...512 char string..." ( 35.0x/32.5x faster!)141*/142143#if defined(__has_feature)144 #if __has_feature(address_sanitizer)145 #define STBI__ASAN __attribute__((no_sanitize("address")))143#if defined(__clang__)144 #if defined(__has_feature) && defined(__has_attribute)145 #if __has_feature(address_sanitizer)146 #if __has_attribute(__no_sanitize__)147 #define STBSP__ASAN __attribute__((__no_sanitize__("address")))148 #elif __has_attribute(__no_sanitize_address__)149 #define STBSP__ASAN __attribute__((__no_sanitize_address__))150 #elif __has_attribute(__no_address_safety_analysis__)151 #define STBSP__ASAN __attribute__((__no_address_safety_analysis__))152 #endif153 #endif154 #endif155#elif __GNUC__ >= 5 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8)156 #if __SANITIZE_ADDRESS__157 #define STBSP__ASAN __attribute__((__no_sanitize_address__))158 #endif159#endif160148#ifndef STBI__ASAN149#define STBI__ASAN161#ifndef STBSP__ASAN162#define STBSP__ASAN163#endif164165#ifdef STB_SPRINTF_STATIC166#define STBSP__PUBLICDEC static154#define STBSP__PUBLICDEF static STBI__ASAN167#define STBSP__PUBLICDEF static STBSP__ASAN168#else169#ifdef __cplusplus170#define STBSP__PUBLICDEC extern "C"158#define STBSP__PUBLICDEF extern "C" STBI__ASAN171#define STBSP__PUBLICDEF extern "C" STBSP__ASAN172#else173#define STBSP__PUBLICDEC extern161#define STBSP__PUBLICDEF STBI__ASAN174#define STBSP__PUBLICDEF STBSP__ASAN175#endif176#endif177178#include <stdarg.h> // for va_list()
1696 unmodified lines