From 2adaef9aa090ce7a0162e3b97397da51d4338163 Mon Sep 17 00:00:00 2001 From: AlexPeshkoff Date: Wed, 30 Dec 2020 17:16:08 +0300 Subject: [PATCH] Finished with warnings cleanup --- examples/empbuild/empbuild.e | 2 +- src/common/os/SyncSignals.h | 6 +++++- src/common/os/posix/SyncSignals.cpp | 28 ++++++++++------------------ src/isql/show.epp | 2 +- src/misc/codes.epp | 4 ++-- 5 files changed, 19 insertions(+), 23 deletions(-) diff --git a/examples/empbuild/empbuild.e b/examples/empbuild/empbuild.e index 5ad9ac3f30..8275bd0480 100644 --- a/examples/empbuild/empbuild.e +++ b/examples/empbuild/empbuild.e @@ -64,7 +64,7 @@ int main ( * Functional description * **************************************/ -TEXT cmd [140]; +TEXT cmd [256]; if (argc > 1) strcpy (Db_name, argv[1]); diff --git a/src/common/os/SyncSignals.h b/src/common/os/SyncSignals.h index 326d538e34..adc1dd6775 100644 --- a/src/common/os/SyncSignals.h +++ b/src/common/os/SyncSignals.h @@ -27,13 +27,17 @@ #define COMMON_SYNC_SIGNALS_H #ifdef UNIX +#ifdef HAVE_SETJMP_H + +#include namespace Firebird { - void syncSignalsSet(void*); + void syncSignalsSet(sigjmp_buf*); void syncSignalsReset(); } +#endif // #ifdef HAVE_SETJMP_H #endif // UNIX #endif // COMMON_SYNC_SIGNALS_H diff --git a/src/common/os/posix/SyncSignals.cpp b/src/common/os/posix/SyncSignals.cpp index d2bba0c9f6..32e8cd0a1c 100644 --- a/src/common/os/posix/SyncSignals.cpp +++ b/src/common/os/posix/SyncSignals.cpp @@ -54,10 +54,6 @@ #include #include -#if defined FREEBSD || defined NETBSD || defined DARWIN || defined HPUX -#define sigset signal -#endif - namespace { // Here we can't use atomic counter instead mutex/counter pair - or some thread may leave SyncSignalsSet() @@ -76,22 +72,19 @@ namespace { } // extern "C" -#ifndef HAVE_SIGSET - typedef void HandlerType(int); - void sigset(int signum, HandlerType* handler) + void fb_sigset(int signum, void (*handler)(int)) { struct sigaction act; memset(&act, 0, sizeof act); act.sa_handler = handler; sigaction(signum, &act, NULL); } -#endif } // anonymous namespace namespace Firebird { -void syncSignalsSet(void* arg) +void syncSignalsSet(sigjmp_buf* sigenv) { /************************************** * @@ -103,17 +96,16 @@ void syncSignalsSet(void* arg) * Set all the synchronous signals for a particular thread * **************************************/ - sigjmp_buf* const sigenv = static_cast(arg); TLS_SET(sigjmpPtr, sigenv); Firebird::MutexLockGuard g(syncEnterMutex, "syncSignalsSet"); if (syncEnterCounter++ == 0) { - sigset(SIGILL, longjmpSigHandler); - sigset(SIGFPE, longjmpSigHandler); - sigset(SIGBUS, longjmpSigHandler); - sigset(SIGSEGV, longjmpSigHandler); + fb_sigset(SIGILL, longjmpSigHandler); + fb_sigset(SIGFPE, longjmpSigHandler); + fb_sigset(SIGBUS, longjmpSigHandler); + fb_sigset(SIGSEGV, longjmpSigHandler); } } @@ -138,10 +130,10 @@ void syncSignalsReset() if (--syncEnterCounter == 0) { - sigset(SIGILL, SIG_DFL); - sigset(SIGFPE, SIG_DFL); - sigset(SIGBUS, SIG_DFL); - sigset(SIGSEGV, SIG_DFL); + fb_sigset(SIGILL, SIG_DFL); + fb_sigset(SIGFPE, SIG_DFL); + fb_sigset(SIGBUS, SIG_DFL); + fb_sigset(SIGSEGV, SIG_DFL); } } diff --git a/src/isql/show.epp b/src/isql/show.epp index 9c04b74c22..88f31e4b7f 100644 --- a/src/isql/show.epp +++ b/src/isql/show.epp @@ -770,7 +770,7 @@ processing_state SHOW_grants2 (const SCHAR* object, prev_user_type = -1; prev_object_type = -1; char priv_string[MAX_PRIV_LIST] = ""; - char col_string[BUFFER_LENGTH256] = ""; + char col_string[BUFFER_LENGTH512] = ""; char with_option[19] = ""; USHORT priv_flags = 0; SSHORT prev_field_null = -1; diff --git a/src/misc/codes.epp b/src/misc/codes.epp index cd96a95f9a..d323320644 100644 --- a/src/misc/codes.epp +++ b/src/misc/codes.epp @@ -739,7 +739,7 @@ static void build_other_headers() int numLines = FB_NELEM(pas_boiler_plate); for (i = 0; i < numLines; i++) { - char buffer[256]; + char buffer[1400]; strcpy(buffer, pas_boiler_plate[i]); char* gds = strstr(buffer, "gds_arg"); if (gds) @@ -923,7 +923,7 @@ static void build_other_headers() static void move_if_not_identical(const char* original, const char* new_file, const char *directory) { char origName[1000]; - char buffer[1000]; + char buffer[1400]; #if defined(WIN_NT) && !defined(__GNUC__) if ( directory != NULL) { sprintf(origName, "%s\\%s", directory, original);