fix default case warnings, add to warning list

This commit is contained in:
Todd A Ouska 2011-06-09 17:11:20 -07:00
parent 5e1c1b8b99
commit 3013a84bd1
4 changed files with 26 additions and 2 deletions

View File

@ -465,7 +465,7 @@ CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
LIB_SOCKET_NSL
dnl Various GCC warnings that should never fire for release quality code
GCCWARNINGS="-Wall -fno-strict-aliasing -W -Wfloat-equal -Wundef \
GCCWARNINGS="-Wall -fno-strict-aliasing -W -Wfloat-equal -Wundef \
-Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
-Wwrite-strings -Wredundant-decls -Wchar-subscripts -Wcomment \
-Wformat=2 -Wwrite-strings -Wmissing-declarations -Wredundant-decls \
@ -473,7 +473,8 @@ GCCWARNINGS="-Wall -fno-strict-aliasing -W -Wfloat-equal -Wundef \
-Wmissing-field-initializers -Wdeclaration-after-statement \
-Wold-style-definition -Waddress -Wmissing-noreturn -Wnormalized=id \
-Woverride-init -Wstrict-overflow=1 -Wextra -Warray-bounds \
-Wstack-protector -Wformat -Wformat-security -Wpointer-sign -Wshadow"
-Wstack-protector -Wformat -Wformat-security -Wpointer-sign -Wshadow \
-Wswitch-default"
AC_ARG_ENABLE(gcc-lots-o-warnings,
AS_HELP_STRING(--enable-gcc-lots-o-warnings, Enable lots of gcc warnings (default: disabled)),

View File

@ -922,6 +922,9 @@ int AesSetKey(Aes* aes, const byte* userKey, word32 keylen, const byte* iv,
rk += 8;
}
break;
default:
return BAD_FUNC_ARG;
}
if (dir == AES_DECRYPTION)

View File

@ -31,6 +31,7 @@
#endif
enum CyaSSL_ErrorCodes {
INPUT_CASE_ERROR = -201, /* process input state error */
PREFIX_ERROR = -202, /* bad index to key rounds */
MEMORY_ERROR = -203, /* out of memory */
VERIFY_FINISHED_ERROR = -204, /* verify problem on finished */

View File

@ -1089,6 +1089,9 @@ retry:
case IO_ERR_CONN_CLOSE: /* peer closed connection */
ssl->options.isClosed = 1;
return -1;
default:
return recvd;
}
return recvd;
@ -1168,6 +1171,9 @@ int SendBuffered(SSL* ssl)
case IO_ERR_CONN_CLOSE: /* epipe / conn closed, same as reset */
ssl->options.connReset = 1;
break;
default:
return SOCKET_ERROR_E;
}
return SOCKET_ERROR_E;
@ -1827,6 +1833,9 @@ static INLINE void Encrypt(SSL* ssl, byte* out, const byte* input, word32 sz)
RabbitProcess(&ssl->encrypt.rabbit, out, input, sz);
break;
#endif
default:
CYASSL_MSG("CyaSSL Encrypt programming error");
}
}
@ -1863,6 +1872,9 @@ static INLINE void Decrypt(SSL* ssl, byte* plain, const byte* input, word32 sz)
RabbitProcess(&ssl->decrypt.rabbit, plain, input, sz);
break;
#endif
default:
CYASSL_MSG("CyaSSL Decrypt programming error");
}
}
@ -2310,6 +2322,9 @@ int ProcessReply(SSL* ssl)
ssl->options.processReply = doProcessInit;
continue;
}
default:
CYASSL_MSG("Bad process input state, programming error");
return INPUT_CASE_ERROR;
}
}
}
@ -2972,6 +2987,10 @@ void SetErrorString(int error, char* str)
XSTRNCPY(str, "unsupported cipher suite", max);
break;
case INPUT_CASE_ERROR :
XSTRNCPY(str, "input state error", max);
break;
case PREFIX_ERROR :
XSTRNCPY(str, "bad index to key rounds", max);
break;