mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-04 17:06:25 +00:00
Clang static analysis builds should use C runtime directly.
This is a little macro magic to use malloc() directly instead of SDL_malloc(), etc, so static analysis tests that know about the C runtime can function properly, and understand that we are dealing with heap allocations, etc. This changed our static analysis report from 5 outstanding bugs to 30. 5x as many bugs were hidden by SDL_malloc() not being recognized as malloc() by the static analyzer!
This commit is contained in:
@@ -18,6 +18,11 @@
|
||||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
|
||||
#if defined(__clang_analyzer__) && !defined(SDL_DISABLE_ANALYZE_MACROS)
|
||||
#define SDL_DISABLE_ANALYZE_MACROS 1
|
||||
#endif
|
||||
|
||||
#include "../SDL_internal.h"
|
||||
|
||||
/* This file contains portable stdlib functions for SDL */
|
||||
|
Reference in New Issue
Block a user