Skip to content

Clean some warnings #397

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/atca_iface.c
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,7 @@ uint8_t ifacecfg_get_address(ATCAIfaceCfg * cfg)
{
#ifdef ATCA_HAL_I2C
case ATCA_I2C_IFACE:
UNUSED(kitiface);
#ifdef ATCA_ENABLE_DEPRECATED
addr = ATCA_IFACECFG_VALUE(cfg, atcai2c.slave_address);
#else
Expand Down
4 changes: 4 additions & 0 deletions lib/cryptoauthlib.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@
#include "atca_helpers.h"
#include "hal/atca_hal.h"

#ifndef UNUSED
#define UNUSED(X) (void)X /* To avoid gcc/g++ "unused-parameter" warnings */
#endif

/* Common Cryptographic Definitions */
#define ATCA_SHA256_BLOCK_SIZE (64u)
#define ATCA_SHA256_DIGEST_SIZE (32u)
Expand Down
5 changes: 5 additions & 0 deletions lib/mbedtls/atca_mbedtls_ecdh.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ int mbedtls_ecdh_gen_public(mbedtls_ecp_group *grp, mbedtls_mpi *d, mbedtls_ecp_
int (*f_rng)(void *, unsigned char *, size_t),
void *p_rng)
{
UNUSED(f_rng);
UNUSED(p_rng);

int ret = 0;
uint8_t public_key[ATCA_PUB_KEY_SIZE];
uint8_t temp = 1;
Expand Down Expand Up @@ -103,6 +106,8 @@ int mbedtls_ecdh_compute_shared(mbedtls_ecp_group *grp, mbedtls_mpi *z,
int (*f_rng)(void *, unsigned char *, size_t),
void *p_rng)
{
UNUSED(f_rng);
UNUSED(p_rng);

int ret = 0;
uint8_t public_key[ATCA_PUB_KEY_SIZE];
Expand Down
2 changes: 1 addition & 1 deletion lib/pkcs11/pkcs11_key.c
Original file line number Diff line number Diff line change
Expand Up @@ -2234,7 +2234,7 @@ static uint8_t pkcs11_key_used(uint8_t * key, size_t keylen)
{
if (key)
{
for (int i = 0; i < keylen; i++)
for (uint8_t i = 0; i < keylen; i++)
{
if (key[i])
{
Expand Down
1 change: 1 addition & 0 deletions lib/pkcs11/pkcs11_slot.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ pkcs11_slot_ctx_ptr pkcs11_slot_get_new_context(pkcs11_lib_ctx_ptr lib_ctx)
CK_VOID_PTR pkcs11_slot_initslots(CK_ULONG pulCount)
{
#ifdef ATCA_NO_HEAP
UNUSED(pulCount);
int i;
for (i = 0; i < PKCS11_MAX_SLOTS_ALLOWED; i++)
{
Expand Down