From fb29ad360f6c91d7d0c23b36a8766aafb6b738aa Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Fri, 10 May 2024 00:25:35 +0200 Subject: [PATCH] Fix warnings that have become errors with GCC 14 --- .../Framework-Debugging/src/expCloneExec/c/expCloneExec.c | 1 + Ghidra/Debug/Framework-Debugging/src/expFork/c/expFork.c | 1 + Ghidra/Debug/Framework-Debugging/src/expSpin/c/expSpin.c | 2 ++ Ghidra/Debug/Framework-Debugging/src/expTypes/c/expTypes.c | 6 +++--- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Ghidra/Debug/Framework-Debugging/src/expCloneExec/c/expCloneExec.c b/Ghidra/Debug/Framework-Debugging/src/expCloneExec/c/expCloneExec.c index 23bd76aeac..1f920bd108 100644 --- a/Ghidra/Debug/Framework-Debugging/src/expCloneExec/c/expCloneExec.c +++ b/Ghidra/Debug/Framework-Debugging/src/expCloneExec/c/expCloneExec.c @@ -15,6 +15,7 @@ */ #include #include +#include pthread_t thread; diff --git a/Ghidra/Debug/Framework-Debugging/src/expFork/c/expFork.c b/Ghidra/Debug/Framework-Debugging/src/expFork/c/expFork.c index 9a72a46716..edb3fa5a80 100644 --- a/Ghidra/Debug/Framework-Debugging/src/expFork/c/expFork.c +++ b/Ghidra/Debug/Framework-Debugging/src/expFork/c/expFork.c @@ -14,6 +14,7 @@ * limitations under the License. */ #include +#include int func(int id) { if (id) { diff --git a/Ghidra/Debug/Framework-Debugging/src/expSpin/c/expSpin.c b/Ghidra/Debug/Framework-Debugging/src/expSpin/c/expSpin.c index d7eea169ae..778c310ced 100644 --- a/Ghidra/Debug/Framework-Debugging/src/expSpin/c/expSpin.c +++ b/Ghidra/Debug/Framework-Debugging/src/expSpin/c/expSpin.c @@ -15,6 +15,8 @@ */ #ifdef WIN32 #include +#else +#include #endif #ifdef WIN32 diff --git a/Ghidra/Debug/Framework-Debugging/src/expTypes/c/expTypes.c b/Ghidra/Debug/Framework-Debugging/src/expTypes/c/expTypes.c index 33ee6f38da..19504f60b8 100644 --- a/Ghidra/Debug/Framework-Debugging/src/expTypes/c/expTypes.c +++ b/Ghidra/Debug/Framework-Debugging/src/expTypes/c/expTypes.c @@ -38,7 +38,7 @@ typedef enum _myenum { typedef void (*myfunc_p)(int arg0, long arg1); typedef void (*myvargfunc_p)(int arg0, long arg1, ...); -typedef myundef; +typedef int myundef; // forbidding to be "undefined" in C99 and later int int_var; void* void_p_var; @@ -86,11 +86,11 @@ int main(int argc, char** argv) { printf("complex: %d\n", sizeof(complex_var)); printf("double complex: %d\n", sizeof(double_complex_var)); - register mycomplex_p cparts = &complex_var; + register mycomplex_p cparts = (mycomplex_p)&complex_var; printf("single real: %f\n", cparts->real); printf("single imag: %f\n", cparts->imag); - mydoublex_p dparts = &double_complex_var; + mydoublex_p dparts = (mydoublex_p)&double_complex_var; printf("double real: %g\n", dparts->real); printf("double imag: %g\n", dparts->imag);