Skip to content

Commit a976f7f

Browse files
committed
SDL_stdinc.h: provide a prototype for strdup for __clang_analyzer__ case
Because strdup is not ANSI but POSIX, and its prototype might be hidden.. Reference issue: libsdl-org#11219. (cherry picked from commit 3ebfdb0)
1 parent 3782344 commit a976f7f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Diff for: include/SDL_stdinc.h

+3
Original file line numberDiff line numberDiff line change
@@ -749,6 +749,9 @@ size_t wcslcpy(wchar_t *dst, const wchar_t *src, size_t size);
749749
size_t wcslcat(wchar_t *dst, const wchar_t *src, size_t size);
750750
#endif
751751

752+
/* strdup is not ANSI but POSIX, and its prototype might be hidden... */
753+
char *strdup(const char *str);
754+
752755
/* Starting LLVM 16, the analyser errors out if these functions do not have
753756
their prototype defined (clang-diagnostic-implicit-function-declaration) */
754757
#include <stdlib.h>

0 commit comments

Comments
 (0)