Skip to content

Redundant declarations in psa/crypto.h and psa/crypto_struct.h #10376

@mschulz-at-hilscher

Description

@mschulz-at-hilscher

Summary

When compiling with -Wredundant-decls and including "psa/crypto.h", we get many redundant declaration warnings.

System information

Mbed TLS version (number or commit id): 3.6.4
Operating system and version: embedded
Configuration (if not default, please attach mbedtls_config.h):
Compiler and options (if you used a pre-built binary, please indicate how you obtained it): -Wredundant-decls
Additional environment information:

Expected behavior

When compiling with -Wredundant-decls, no warnings shall be generated.

Actual behavior

For example:

psa/crypto.h:126:29: error: redundant redeclaration of 'psa_key_attributes_init'
psa/crypto_struct.h:329:43: note: previous definition of 'psa_key_attributes_init' was here

This is due to the fact, that the functions that the functions in crypto.h are declared without inline, for example:

static psa_key_attributes_t psa_key_attributes_init(void);

While in crypto_structs.h they are defined as inline function, for example:

static inline struct psa_key_attributes_s psa_key_attributes_init(void)

Steps to reproduce

compile a c file that includes psa/crypto.h with -Wredundant-decls.

Additional information

Metadata

Metadata

Assignees

No fields configured for Feature.

Projects

Status
No status
Status
Stalled

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions