Skip to content
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

mbedtls fails to build in psa_crypto.c #1330

Open
winspool opened this issue Aug 21, 2024 · 1 comment
Open

mbedtls fails to build in psa_crypto.c #1330

winspool opened this issue Aug 21, 2024 · 1 comment

Comments

@winspool
Copy link
Contributor

winspool commented Aug 21, 2024

Projekt mbed-tls from github: https://github.com/Mbed-TLS/mbedtls.git

OpenWatcom stops, when compiling psa_crypto.c: https://github.com/Mbed-TLS/mbedtls/blob/ddc080073ca665afef4dadebec5b4b1d760a54d7/tf-psa-crypto/core/psa_crypto.c#L9135

tf-psa-crypto/core/psa_crypto.c(9135): Error! E1063: Missing operand
tf-psa-crypto/core/psa_crypto.c(9135): Error! E1009: Expecting ')' but found '{'
mbedtls/tf-psa-crypto/core/psa_crypto.c(9135): Error! E1010: Type mismatch
tf-psa-crypto/core/psa_crypto.c(9135): Note! N2003: source conversion type is 'int'
tf-psa-crypto/core/psa_crypto.c(9135): Note! N2004: target conversion type is 'struct psa_crypto_local_input_s'
... (rest of the output stripped)

A reduced testcase with the same compilation break:

#include <stddef.h>

typedef int psa_status_t;
typedef unsigned char uint8_t;

typedef struct psa_crypto_local_input_s {
    uint8_t *buffer;
    size_t length;
} psa_crypto_local_input_t;

#define PSA_CRYPTO_LOCAL_INPUT_INIT ((psa_crypto_local_input_t) { NULL, 0 })


psa_status_t psa_crypto_local_input_alloc(const uint8_t *input, size_t input_len,
                                          psa_crypto_local_input_t *local_input)
{

    *local_input = PSA_CRYPTO_LOCAL_INPUT_INIT;

    return 0;
}

Compiler output, when compiling the testcase (adding -za99 -aa makes no difference):

$ wcc386  -za99 -aa -fo=init_macro.o -fr init_macro.c
... 
$ wcc386   -fo=init_macro.o -fr init_macro.c 
init_macro.c(18): Error! E1063: Missing operand
init_macro.c(18): Error! E1009: Expecting ')' but found '{'
init_macro.c(18): Error! E1010: Type mismatch
init_macro.c(18): Note! N2003: source conversion type is 'int'
init_macro.c(18): Note! N2004: target conversion type is 'struct psa_crypto_local_input_s'
init_macro.c(18): Error! E1009: Expecting ';' but found '}'
init_macro.c(18): Warning! W107: Missing return value for function 'psa_crypto_local_input_alloc'
init_macro.c(18): Error! E1061: Expecting data or function declaration, but found ')'
init_macro.c(18): Error! E1026: Invalid declarator
init_macro.c(20): Error! E1099: Statement must be inside function. Probable cause: missing {
Error: Compiler returned a bad status compiling 'init_macro.c'
@jmalak
Copy link
Member

jmalak commented Aug 21, 2024

what problem you are reporting? That some source file is not compiled? What standard source file is conformant?
you should read OW conformance

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants