fix warnings compiling sqllite with latest gcc version

This commit is contained in:
Paul Gardner-Stephen 2020-07-10 08:53:56 +09:30
parent 77bdbd9cf1
commit 338c9bed1f

View File

@ -25023,6 +25023,7 @@ SQLITE_PRIVATE void sqlite3VXPrintf(
flag_longlong = sizeof(char*)==sizeof(i64);
flag_long = sizeof(char*)==sizeof(long int);
/* Fall through into the next case */
// Fall through
case etORDINAL:
case etRADIX:
if( infop->flags & FLAG_SIGNED ){
@ -27391,7 +27392,9 @@ SQLITE_PRIVATE void sqlite3ErrorWithMsg(sqlite3 *db, int err_code, const char *z
va_start(ap, zFormat);
z = sqlite3VMPrintf(db, zFormat, ap);
va_end(ap);
#pragma GCC diagnostic ignored "-Wcast-function-type"
sqlite3ValueSetStr(db->pErr, -1, z, SQLITE_UTF8, SQLITE_DYNAMIC);
#pragma GCC diagnostic pop
}
}
@ -69553,7 +69556,9 @@ SQLITE_PRIVATE int sqlite3VdbeMemSetStr(
return SQLITE_NOMEM_BKPT;
}
memcpy(pMem->z, z, nAlloc);
#pragma GCC diagnostic ignored "-Wcast-function-type"
}else if( xDel==SQLITE_DYNAMIC ){
#pragma GCC diagnostic pop
sqlite3VdbeMemRelease(pMem);
pMem->zMalloc = pMem->z = (char *)z;
pMem->szMalloc = sqlite3DbMallocSize(pMem->db, pMem->zMalloc);
@ -69965,7 +69970,9 @@ static int valueFromExpr(
}else{
zVal = sqlite3MPrintf(db, "%s%s", zNeg, pExpr->u.zToken);
if( zVal==0 ) goto no_mem;
#pragma GCC diagnostic ignored "-Wcast-function-type"
sqlite3ValueSetStr(pVal, -1, zVal, SQLITE_UTF8, SQLITE_DYNAMIC);
#pragma GCC diagnostic pop
}
if( (op==TK_INTEGER || op==TK_FLOAT ) && affinity==SQLITE_AFF_BLOB ){
sqlite3ValueApplyAffinity(pVal, SQLITE_AFF_NUMERIC, SQLITE_UTF8);
@ -70006,8 +70013,10 @@ static int valueFromExpr(
zVal = &pExpr->u.zToken[2];
nVal = sqlite3Strlen30(zVal)-1;
assert( zVal[nVal]=='\'' );
#pragma GCC diagnostic ignored "-Wcast-function-type"
sqlite3VdbeMemSetStr(pVal, sqlite3HexToBlob(db, zVal, nVal), nVal/2,
0, SQLITE_DYNAMIC);
#pragma GCC diagnostic pop
}
#endif
@ -70920,8 +70929,8 @@ static void resolveP2Values(Vdbe *p, int *pMaxFuncArgs){
switch( pOp->opcode ){
case OP_Transaction: {
if( pOp->p2!=0 ) p->readOnly = 0;
/* fall thru */
}
/* fall thru */
case OP_AutoCommit:
case OP_Savepoint: {
p->bIsReader = 1;
@ -78083,6 +78092,7 @@ case OP_HaltIfNull: { /* in3 */
** every program. So a jump past the last instruction of the program
** is the same as executing Halt.
*/
// Fall through
case OP_Halt: {
VdbeFrame *pFrame;
int pcx;
@ -78233,6 +78243,7 @@ case OP_String8: { /* same as TK_STRING, out2 */
**
** if( P3!=0 and reg[P3]==P5 ) reg[P2] := CAST(reg[P2] as BLOB)
*/
// Fall through
case OP_String: { /* out2 */
assert( pOp->p4.z!=0 );
pOut = out2Prerelease(p, pOp);
@ -78789,6 +78800,7 @@ case OP_Function0: {
pOp->opcode = OP_Function;
/* Fall through into OP_Function */
}
// Fall through
case OP_Function: {
int i;
sqlite3_context *pCtx;
@ -80485,6 +80497,7 @@ case OP_ReopenIdx: {
}
/* If the cursor is not currently open or is open on a different
** index, then fall through into OP_OpenRead to force a reopen */
// Fall through
case OP_OpenRead:
case OP_OpenWrite:
@ -81209,6 +81222,7 @@ case OP_SeekRowid: { /* jump, in3 */
if( (pIn3->flags & MEM_Int)==0 ) goto jump_to_p2;
}
/* Fall through into OP_NotExists */
// Fall through
case OP_NotExists: /* jump, in3 */
pIn3 = &aMem[pOp->p3];
assert( pIn3->flags & MEM_Int );
@ -81954,6 +81968,7 @@ case OP_Sort: { /* jump */
** from the beginning toward the end. In other words, the cursor is
** configured to use Next, not Prev.
*/
// Fall through
case OP_Rewind: { /* jump */
VdbeCursor *pC;
BtCursor *pCrsr;
@ -83170,8 +83185,8 @@ case OP_AggStep0: {
pOp->p4type = P4_FUNCCTX;
pOp->p4.pCtx = pCtx;
pOp->opcode = OP_AggStep;
/* Fall through into OP_AggStep */
}
// Fall through
case OP_AggStep: {
int i;
sqlite3_context *pCtx;
@ -92182,7 +92197,8 @@ SQLITE_PRIVATE int sqlite3ExprCodeTarget(Parse *pParse, Expr *pExpr, int target)
break;
}
/* Otherwise, fall thru into the TK_COLUMN case */
}
}
// Fall through
case TK_COLUMN: {
int iTab = pExpr->iTable;
if( iTab<0 ){
@ -93924,7 +93940,9 @@ static void renameTableFunc(
zRet = sqlite3MPrintf(db, "%.*s\"%w\"%s", (int)(((u8*)tname.z) - zSql),
zSql, zTableName, tname.z+tname.n);
#pragma GCC diagnostic ignored "-Wcast-function-type"
sqlite3_result_text(context, zRet, -1, SQLITE_DYNAMIC);
#pragma GCC diagnostic pop
}
}
@ -93987,8 +94005,10 @@ static void renameParentFunc(
}
}
#pragma GCC diagnostic ignored "-Wcast-function-type"
zResult = sqlite3MPrintf(db, "%s%s", (zOutput?zOutput:""), zInput),
sqlite3_result_text(context, zResult, -1, SQLITE_DYNAMIC);
#pragma GCC diagnostic pop
sqlite3DbFree(db, zOutput);
}
#endif
@ -94065,7 +94085,9 @@ static void renameTriggerFunc(
*/
zRet = sqlite3MPrintf(db, "%.*s\"%w\"%s", (int)(((u8*)tname.z) - zSql),
zSql, zTableName, tname.z+tname.n);
#pragma GCC diagnostic ignored "-Wcast-function-type"
sqlite3_result_text(context, zRet, -1, SQLITE_DYNAMIC);
#pragma GCC diagnostic pop
}
}
#endif /* !SQLITE_OMIT_TRIGGER */
@ -103457,8 +103479,10 @@ static void printfFunc(
str.printfFlags = SQLITE_PRINTF_SQLFUNC;
sqlite3XPrintf(&str, zFormat, &x);
n = str.nChar;
#pragma GCC diagnostic ignored "-Wcast-function-type"
sqlite3_result_text(context, sqlite3StrAccumFinish(&str), n,
SQLITE_DYNAMIC);
#pragma GCC diagnostic pop
}
}
@ -106384,6 +106408,7 @@ static Trigger *fkActionTrigger(
pStep->op = TK_DELETE;
break;
}
// Fall through
default:
pStep->op = TK_UPDATE;
}
@ -107871,6 +107896,7 @@ SQLITE_PRIVATE void sqlite3GenerateConstraintChecks(
onError = OE_Abort;
/* Fall thru into the next case */
}
// Fall through
case OE_Rollback:
case OE_Abort:
case OE_Fail: {
@ -115089,19 +115115,25 @@ static void generateColumnNames(
zCol = pTab->aCol[iCol].zName;
}
if( !shortNames && !fullNames ){
#pragma GCC diagnostic ignored "-Wcast-function-type"
sqlite3VdbeSetColName(v, i, COLNAME_NAME,
sqlite3DbStrDup(db, pEList->a[i].zSpan), SQLITE_DYNAMIC);
#pragma GCC diagnostic pop
}else if( fullNames ){
char *zName = 0;
zName = sqlite3MPrintf(db, "%s.%s", pTab->zName, zCol);
#pragma GCC diagnostic ignored "-Wcast-function-type"
sqlite3VdbeSetColName(v, i, COLNAME_NAME, zName, SQLITE_DYNAMIC);
#pragma GCC diagnostic pop
}else{
sqlite3VdbeSetColName(v, i, COLNAME_NAME, zCol, SQLITE_TRANSIENT);
}
}else{
const char *z = pEList->a[i].zSpan;
z = z==0 ? sqlite3MPrintf(db, "column%d", i+1) : sqlite3DbStrDup(db, z);
#pragma GCC diagnostic ignored "-Wcast-function-type"
sqlite3VdbeSetColName(v, i, COLNAME_NAME, z, SQLITE_DYNAMIC);
#pragma GCC diagnostic pop
}
}
generateColumnTypes(pParse, pTabList, pEList);
@ -135877,6 +135909,7 @@ SQLITE_PRIVATE int sqlite3GetToken(const unsigned char *z, int *tokenType){
/* If the next character is a digit, this is a floating point
** number that begins with ".". Fall thru into the next case */
}
// fall through
case CC_DIGIT: {
testcase( z[0]=='0' ); testcase( z[0]=='1' ); testcase( z[0]=='2' );
testcase( z[0]=='3' ); testcase( z[0]=='4' ); testcase( z[0]=='5' );
@ -135981,6 +136014,7 @@ SQLITE_PRIVATE int sqlite3GetToken(const unsigned char *z, int *tokenType){
/* If it is not a BLOB literal, then it must be an ID, since no
** SQL keywords start with the letter 'x'. Fall through */
}
// Fall through
case CC_ID: {
i = 1;
break;