Fix warnings found by clang in CI

Reviewed-by: Nicola Tuveri <nic.tuv@gmail.com>
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
(Merged from https://github.com/openssl/openssl/pull/24047)
This commit is contained in:
Neil Horman 2024-04-06 10:16:50 -04:00
parent 44f05ded99
commit f2f13cff21
9 changed files with 16 additions and 16 deletions

View File

@ -64,8 +64,8 @@ static const unsigned char ccm_tag[] = {
* algorithm implementations. If they are NULL then the default library
* context and properties are used.
*/
OSSL_LIB_CTX *libctx = NULL;
const char *propq = NULL;
static OSSL_LIB_CTX *libctx = NULL;
static const char *propq = NULL;
static int aes_ccm_encrypt(void)

View File

@ -64,8 +64,8 @@ static const unsigned char gcm_tag[] = {
* algorithm implementations. If they are NULL then the default library
* context and properties are used.
*/
OSSL_LIB_CTX *libctx = NULL;
const char *propq = NULL;
static OSSL_LIB_CTX *libctx = NULL;
static const char *propq = NULL;
static int aes_gcm_encrypt(void)
{

View File

@ -50,8 +50,8 @@ static const unsigned char wrap_ct[] = {
* algorithm implementations. If they are NULL then the default library
* context and properties are used.
*/
OSSL_LIB_CTX *libctx = NULL;
const char *propq = NULL;
static OSSL_LIB_CTX *libctx = NULL;
static const char *propq = NULL;
static int aes_wrap_encrypt(void)
{

View File

@ -49,8 +49,8 @@ static const unsigned char cbc_ct[] = {
* algorithm implementations. If they are NULL then the default library
* context and properties are used.
*/
OSSL_LIB_CTX *libctx = NULL;
const char *propq = NULL;
static OSSL_LIB_CTX *libctx = NULL;
static const char *propq = NULL;
static int aria_cbc_encrypt(void)
{

View File

@ -24,7 +24,7 @@
* more than once.
*/
const char *hamlet_1 =
static const char *hamlet_1 =
"To be, or not to be, that is the question,\n"
"Whether tis nobler in the minde to suffer\n"
"The ſlings and arrowes of outragious fortune,\n"
@ -43,7 +43,7 @@ const char *hamlet_1 =
"The oppressor's wrong, the proud man's Contumely,\n"
"The pangs of dispised love, the Law's delay,\n"
;
const char *hamlet_2 =
static const char *hamlet_2 =
"The insolence of Office, and the spurns\n"
"That patient merit of the'unworthy takes,\n"
"When he himself might his Quietas make\n"
@ -65,7 +65,7 @@ const char *hamlet_2 =
;
/* The known value of the SHA3-512 digest of the above soliloqy */
const unsigned char known_answer[] = {
static const unsigned char known_answer[] = {
0xbb, 0x69, 0xf8, 0x09, 0x9c, 0x2e, 0x00, 0x3d,
0xa4, 0x29, 0x5f, 0x59, 0x4b, 0x89, 0xe4, 0xd9,
0xdb, 0xa2, 0xe5, 0xaf, 0xa5, 0x87, 0x73, 0x9d,

View File

@ -27,7 +27,7 @@
*/
/* Our input to the XOF hash function. */
const char message[] = "This is a test message.";
static const char message[] = "This is a test message.";
/* Expected output when an output length of 20 bytes is used. */
static const unsigned char known_answer[] = {

View File

@ -231,7 +231,7 @@ int main(int argc, char *argv[])
unsigned char alpn[] = { 8, 'h', 't', 't', 'p', '/', '1', '.', '0' };
const char *request_start = "GET / HTTP/1.0\r\nConnection: close\r\nHost: ";
const char *request_end = "\r\n\r\n";
size_t written, readbytes;
size_t written, readbytes = 0;
char buf[160];
BIO_ADDR *peer_addr = NULL;
int eof = 0;

View File

@ -183,7 +183,7 @@ int main(int argc, char *argv[])
int ret;
const char *request_start = "GET / HTTP/1.0\r\nConnection: close\r\nHost: ";
const char *request_end = "\r\n\r\n";
size_t written, readbytes;
size_t written, readbytes = 0;
char buf[160];
int eof = 0;
char *hostname, *port;

View File

@ -47,8 +47,8 @@ static const char hexseed[] =
"cba30ccd905aa7675a0b81769704bf3c"
"ccf2ca1892b2eaf6b9e2b38d9bf6affc"
"42ada55986d8a1772b442770954d0b65";
const int gindex = 42;
const int pcounter = 363;
static const int gindex = 42;
static const int pcounter = 363;
static const char digest[] = "SHA384";
/*