Skip to content

Commit

Permalink
SDL_stdinc.h: provide a prototype for strdup for __clang_analyzer__ case
Browse files Browse the repository at this point in the history
Because strdup is not ANSI but POSIX, and its prototype might be hidden..

... and re-enable clang-tidy in CI for LoongArch64.

Fixes:  libsdl-org#11219.
  • Loading branch information
sezero committed Oct 16, 2024
1 parent d9df87f commit 3ebfdb0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 0 additions & 1 deletion .github/workflows/create-test-plan.py
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,6 @@ def spec_to_job(spec: JobSpec, key: str, trackmem_symbol_names: bool) -> JobDeta
))
job.shared_lib = SharedLibType.SO_0
job.static_lib = StaticLibType.A
job.clang_tidy = False
case SdlPlatform.N3ds:
job.shared = False
job.apt_packages = ["ninja-build", "binutils"]
Expand Down
3 changes: 3 additions & 0 deletions include/SDL3/SDL_stdinc.h
Original file line number Diff line number Diff line change
Expand Up @@ -4244,6 +4244,9 @@ size_t wcslcpy(wchar_t *dst, const wchar_t *src, size_t size);
size_t wcslcat(wchar_t *dst, const wchar_t *src, size_t size);
#endif

/* strdup is not ANSI but POSIX, and its prototype might be hidden... */
char *strdup(const char *str);

/* Starting LLVM 16, the analyser errors out if these functions do not have
their prototype defined (clang-diagnostic-implicit-function-declaration) */
#include <stdio.h>
Expand Down

0 comments on commit 3ebfdb0

Please sign in to comment.