8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-22 20:03:02 +01:00

Fixed some gcc8 warnings - WiP

This commit is contained in:
AlexPeshkoff 2019-03-18 20:10:31 +03:00
parent 41b2683b8a
commit 84a682bf17
16 changed files with 21 additions and 53 deletions

View File

@ -20,7 +20,7 @@
COMMON_FLAGS=-ggdb -DFB_SEND_FLAGS=MSG_NOSIGNAL -DLINUX -pipe -MMD -fPIC -fmessage-length=0
OPTIMIZE_FLAGS=-O3 -march=i586 -mtune=i686 -fno-omit-frame-pointer
WARN_FLAGS=-Wall -Wno-switch -Wno-parentheses -Wno-unknown-pragmas -Wno-unused-variable -Wno-narrowing
WARN_FLAGS=-Wall -Wno-switch -Wno-parentheses -Wno-unknown-pragmas -Wno-unused-variable -Wno-narrowing -Wno-class-memaccess
PROD_FLAGS=$(COMMON_FLAGS) $(OPTIMIZE_FLAGS)
#DEV_FLAGS=-DUSE_VALGRIND -p $(COMMON_FLAGS) $(WARN_FLAGS)

View File

@ -20,7 +20,7 @@
COMMON_FLAGS=-ggdb -DFB_SEND_FLAGS=MSG_NOSIGNAL -DLINUX -DAMD64 -pipe -MMD -fPIC -fmessage-length=0
OPTIMIZE_FLAGS=-O3 -fno-omit-frame-pointer
WARN_FLAGS=-Wall -Wno-switch -Wno-parentheses -Wno-unknown-pragmas -Wno-unused-variable -Wno-invalid-offsetof -Wno-narrowing -Wno-unused-local-typedefs
WARN_FLAGS=-Wall -Wno-switch -Wno-parentheses -Wno-unknown-pragmas -Wno-unused-variable -Wno-invalid-offsetof -Wno-narrowing -Wno-unused-local-typedefs -Wno-class-memaccess
PROD_FLAGS=$(COMMON_FLAGS) $(OPTIMIZE_FLAGS)
#DEV_FLAGS=-DUSE_VALGRIND $(COMMON_FLAGS) $(WARN_FLAGS) -fmax-errors=8

View File

@ -751,7 +751,6 @@ AC_CHECK_HEADERS(errno.h)
AC_CHECK_HEADERS(fcntl.h)
AC_CHECK_HEADERS(grp.h)
AC_CHECK_HEADERS(pwd.h)
AC_CHECK_HEADERS(libio.h)
AC_CHECK_HEADERS(locale.h)
AC_CHECK_HEADERS(math.h)
AC_CHECK_HEADERS(pthread.h)
@ -794,7 +793,6 @@ AC_CHECK_HEADERS(float.h)
AC_CHECK_HEADERS(poll.h)
AC_CHECK_HEADERS(langinfo.h)
AC_CHECK_HEADERS(iconv.h)
AC_CHECK_HEADERS(libio.h)
AC_CHECK_HEADERS(linux/falloc.h)
AC_CHECK_HEADERS(utime.h)

View File

@ -794,7 +794,7 @@ static USHORT unicodeStrToKey(texttype* tt, USHORT srcLen, const UCHAR* src,
return impl->collation->stringToKey(utf16Len, (USHORT*)utf16Str.begin(), dstLen, dst, keyType);
}
catch (BadAlloc)
catch (const BadAlloc&)
{
fb_assert(false);
return INTL_BAD_KEY_LENGTH;
@ -859,7 +859,7 @@ static SSHORT unicodeCompare(texttype* tt, ULONG len1, const UCHAR* str1,
return impl->collation->compare(utf16Len1, (USHORT*)utf16Str1.begin(),
utf16Len2, (USHORT*)utf16Str2.begin(), errorFlag);
}
catch (BadAlloc)
catch (const BadAlloc&)
{
fb_assert(false);
return 0;
@ -902,7 +902,7 @@ static ULONG unicodeCanonical(texttype* tt, ULONG srcLen, const UCHAR* src, ULON
utf16Len, Firebird::Aligner<USHORT>(utf16Str.begin(), utf16Len),
dstLen, Firebird::OutAligner<ULONG>(dst, dstLen), NULL);
}
catch (BadAlloc)
catch (const BadAlloc&)
{
fb_assert(false);
return INTL_BAD_KEY_LENGTH;

View File

@ -60,7 +60,7 @@ Synchronize::Synchronize()
#ifdef WIN_NT
evnt = CreateEvent(NULL, false, false, NULL);
#else
int ret = pthread_mutex_init(&mutex, NULL);
pthread_mutex_init(&mutex, NULL);
pthread_cond_init(&condition, NULL);
#endif
}
@ -70,8 +70,8 @@ Synchronize::~Synchronize()
#ifdef WIN_NT
CloseHandle(evnt);
#else
int ret = pthread_mutex_destroy(&mutex);
ret = pthread_cond_destroy(&condition);
pthread_mutex_destroy(&mutex);
pthread_cond_destroy(&condition);
#endif
}

View File

@ -221,9 +221,6 @@
/* Define to 1 if you have the `atomic_ops' library (-latomic_ops). */
/* #undef HAVE_LIBATOMIC_OPS */
/* Define to 1 if you have the <libio.h> header file. */
/* #undef HAVE_LIBIO_H */
/* Define to 1 if you have the `m' library (-lm). */
#define HAVE_LIBM 1

View File

@ -227,9 +227,6 @@
/* Define to 1 if you have the `atomic_ops' library (-latomic_ops). */
/* #undef HAVE_LIBATOMIC_OPS */
/* Define to 1 if you have the <libio.h> header file. */
/* #undef HAVE_LIBIO_H */
/* Define to 1 if you have the `m' library (-lm). */
#define HAVE_LIBM 1

View File

@ -221,9 +221,6 @@
/* Define to 1 if you have the `atomic_ops' library (-latomic_ops). */
/* #undef HAVE_LIBATOMIC_OPS */
/* Define to 1 if you have the <libio.h> header file. */
/* #undef HAVE_LIBIO_H */
/* Define to 1 if you have the `m' library (-lm). */
#define HAVE_LIBM 1

View File

@ -221,9 +221,6 @@
/* Define to 1 if you have the `atomic_ops' library (-latomic_ops). */
/* #undef HAVE_LIBATOMIC_OPS */
/* Define to 1 if you have the <libio.h> header file. */
/* #undef HAVE_LIBIO_H */
/* Define to 1 if you have the `m' library (-lm). */
#define HAVE_LIBM 1

View File

@ -483,7 +483,7 @@ INTL_BOOL FB_DLL_EXPORT LD_lookup_charset(charset* cs, const ASCII* name, const
return CSICU_charset_init(cs, name);
}
catch (Firebird::BadAlloc)
catch (const Firebird::BadAlloc&)
{
fb_assert(false);
return false;
@ -549,7 +549,7 @@ INTL_BOOL FB_DLL_EXPORT LD_lookup_texttype(texttype* tt, const ASCII* texttype_n
tt, texttype_name, charset_name, attributes, specific_attributes,
specific_attributes_length, configInfo);
}
catch (Firebird::BadAlloc)
catch (const Firebird::BadAlloc&)
{
fb_assert(false);
return false;

View File

@ -3317,8 +3317,8 @@ bool RseNode::computable(CompilerScratch* csb, StreamType stream,
if (rse_first && !rse_first->computable(csb, stream, allowOnlyCurrentStream))
return false;
if (rse_skip && !rse_skip->computable(csb, stream, allowOnlyCurrentStream))
return false;
if (rse_skip && !rse_skip->computable(csb, stream, allowOnlyCurrentStream))
return false;
const NestConst<RecordSourceNode>* const end = rse_relations.end();
NestConst<RecordSourceNode>* ptr;
@ -3353,8 +3353,8 @@ void RseNode::findDependentFromStreams(const OptimizerRetrieval* optRet,
if (rse_first)
rse_first->findDependentFromStreams(optRet, streamList);
if (rse_skip)
rse_skip->findDependentFromStreams(optRet, streamList);
if (rse_skip)
rse_skip->findDependentFromStreams(optRet, streamList);
if (rse_boolean)
rse_boolean->findDependentFromStreams(optRet, streamList);

View File

@ -2704,7 +2704,7 @@ JAttachment* JProvider::createDatabase(CheckStatusWrapper* user_status, const ch
// try to create with overwrite = false
pageSpace->file = PIO_create(tdbb, expanded_name, false, false);
}
catch (status_exception)
catch (const status_exception&)
{
if (options.dpb_overwrite)
{

View File

@ -3316,14 +3316,13 @@ static void transaction_start(thread_db* tdbb, jrd_tra* trans)
// the transaction inventory page was initialized to zero, it
// transaction is automatically marked active.
TraNumber oldest, number, active, oldest_active, oldest_snapshot;
TraNumber oldest, number, active, oldest_active;
#ifdef SUPERSERVER_V2
number = bump_transaction_id(tdbb, &window);
oldest = dbb->dbb_oldest_transaction;
active = MAX(dbb->dbb_oldest_active, dbb->dbb_oldest_transaction);
oldest_active = dbb->dbb_oldest_active;
oldest_snapshot = dbb->dbb_oldest_snapshot;
#else // SUPERSERVER_V2
if (dbb->readOnly())
@ -3331,7 +3330,6 @@ static void transaction_start(thread_db* tdbb, jrd_tra* trans)
number = dbb->generateTransactionId();
oldest = dbb->dbb_oldest_transaction;
oldest_active = dbb->dbb_oldest_active;
oldest_snapshot = dbb->dbb_oldest_snapshot;
}
else
{
@ -3342,7 +3340,6 @@ static void transaction_start(thread_db* tdbb, jrd_tra* trans)
number = Ods::getNT(header);
oldest = Ods::getOIT(header);
oldest_active = Ods::getOAT(header);
oldest_snapshot = Ods::getOST(header);
}
// oldest (OIT) > oldest_active (OAT) if OIT was advanced by sweep

View File

@ -719,7 +719,7 @@ bool VIO_chase_record_version(thread_db* tdbb, record_param* rpb,
rpb->rpb_f_page, rpb->rpb_f_line);
#endif
CommitNumber current_snapshot_number, prev_snapshot_number = 0;
CommitNumber current_snapshot_number;
bool int_gc_done = (attachment->att_flags & ATT_no_cleanup);
int state = TRA_snapshot_state(tdbb, transaction, rpb->rpb_transaction_nr, &current_snapshot_number);
@ -800,7 +800,7 @@ bool VIO_chase_record_version(thread_db* tdbb, record_param* rpb,
// Worry about intermediate GC if necessary
if (!int_gc_done &&
(//(prev_snapshot_number && prev_snapshot_number == current_snapshot_number) ||
(
((tdbb->tdbb_flags & TDBB_sweeper) && state == tra_committed &&
rpb->rpb_b_page != 0 && rpb->rpb_transaction_nr >= oldest_snapshot)))
{
@ -820,8 +820,6 @@ bool VIO_chase_record_version(thread_db* tdbb, record_param* rpb,
}
}
prev_snapshot_number = current_snapshot_number;
if (state == tra_committed)
state = check_precommitted(transaction, rpb);
@ -887,7 +885,6 @@ bool VIO_chase_record_version(thread_db* tdbb, record_param* rpb,
if (!DPM_get(tdbb, rpb, LCK_read))
return false;
prev_snapshot_number = 0;
state = TRA_snapshot_state(tdbb, transaction, rpb->rpb_transaction_nr, &current_snapshot_number);
continue;
}
@ -940,7 +937,6 @@ bool VIO_chase_record_version(thread_db* tdbb, record_param* rpb,
{
if (!DPM_get(tdbb, rpb, LCK_read))
return false;
prev_snapshot_number = 0;
break;
}
@ -953,7 +949,6 @@ bool VIO_chase_record_version(thread_db* tdbb, record_param* rpb,
if (!DPM_get(tdbb, rpb, LCK_read))
return false;
prev_snapshot_number = 0;
break;
}
@ -976,7 +971,6 @@ bool VIO_chase_record_version(thread_db* tdbb, record_param* rpb,
{
if (!DPM_get(tdbb, rpb, LCK_read))
return false;
prev_snapshot_number = 0;
}
++backversions;
@ -989,8 +983,6 @@ bool VIO_chase_record_version(thread_db* tdbb, record_param* rpb,
if (!DPM_get(tdbb, rpb, LCK_read))
return false;
prev_snapshot_number = 0;
} // scope
break;
@ -1048,7 +1040,6 @@ bool VIO_chase_record_version(thread_db* tdbb, record_param* rpb,
{
if (!DPM_get(tdbb, rpb, LCK_read))
return false;
prev_snapshot_number = 0;
}
++backversions;
@ -1073,7 +1064,6 @@ bool VIO_chase_record_version(thread_db* tdbb, record_param* rpb,
// Things have changed, start all over again.
if (!DPM_get(tdbb, rpb, LCK_read))
return false; // entire record disappeared
prev_snapshot_number = 0;
break; // start from the primary version again
}
}
@ -1086,7 +1076,6 @@ bool VIO_chase_record_version(thread_db* tdbb, record_param* rpb,
// Things have changed, start all over again.
if (!DPM_get(tdbb, rpb, LCK_read))
return false; // entire record disappeared
prev_snapshot_number = 0;
break; // start from the primary version again
}
@ -1095,7 +1084,6 @@ bool VIO_chase_record_version(thread_db* tdbb, record_param* rpb,
CCH_RELEASE(tdbb, &rpb->getWindow(tdbb));
if (!DPM_get(tdbb, rpb, LCK_read))
return false;
prev_snapshot_number = 0;
break;
}
@ -1115,7 +1103,6 @@ bool VIO_chase_record_version(thread_db* tdbb, record_param* rpb,
{
if (!DPM_get(tdbb, rpb, LCK_read))
return false;
prev_snapshot_number = 0;
}
++backversions;
@ -1241,7 +1228,6 @@ bool VIO_chase_record_version(thread_db* tdbb, record_param* rpb,
// Go back to be primary record version and chase versions all over again.
if (!DPM_get(tdbb, rpb, LCK_read))
return false;
prev_snapshot_number = 0;
} // switch (state)
state = TRA_snapshot_state(tdbb, transaction, rpb->rpb_transaction_nr, &current_snapshot_number);

View File

@ -489,7 +489,8 @@ int PRO_rename_procedure( qli_dbb* database, const TEXT* old_name, const TEXT* n
USHORT count = 0;
FOR(REQUEST_HANDLE request) X IN DB.QLI$PROCEDURES WITH
X.QLI$PROCEDURE_NAME EQ old_name count++;
X.QLI$PROCEDURE_NAME EQ old_name
count++;
MODIFY X USING
isc_vtof(new_name, X.QLI$PROCEDURE_NAME, sizeof(X.QLI$PROCEDURE_NAME));
END_MODIFY

View File

@ -31,9 +31,7 @@
#ifndef JRD_PERF_H
#define JRD_PERF_H
#ifdef HAVE_LIBIO_H
#include <libio.h>
#endif
#include <stdio.h>
#ifdef HAVE_TIMES
#include <sys/types.h>